Typewriter(TextMeshProUGUI,float,Action,CoroutineInterruptToken)

Method in Effects

Summary

A coroutine that gradually reveals the text in a TMPro.TextMeshProUGUI object over time.

public static IEnumerator Typewriter(TextMeshProUGUI text, float lettersPerSecond, Action onCharacterTyped, CoroutineInterruptToken stopToken = null)

Remarks

This method works by adjusting the value of the text parameter's TextMeshProUGUI.maxVisibleCharacters property. This means that word wrapping will not change half-way through the presentation of a word.

Depending on the value of lettersPerSecond, onCharacterTyped may be called multiple times per frame.

Due to an internal implementation detail of TextMeshProUGUI, this method will always take at least one frame to execute, regardless of the length of the text parameter's text.

Parameters

Last updated

Yarn Spinnerยฎ and Secret Labยฎ are trade marks of Secret Lab Pty. Ltd., and are used by Yarn Spinner Pty. Ltd. under license.