Method in Effects
A coroutine that gradually reveals the text in a TextMeshProUGUI
object over time.
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.
Name | Description |
---|---|
TextMeshProUGUI
text
A TextMeshProUGUI object to reveal the text of.
float
lettersPerSecond
The number of letters that should be revealed per second.
Action
onCharacterTyped
An Action
that should be called for each character that was revealed.
A CoroutineInterruptToken that can be used to interrupt the coroutine.