Text Animator Players
Last updated
Last updated
You're reading the documentation of an older/legacy version, Text Animator 1.X. To read the latest version, please visit this page instead . How to update:
You can use TextAnimatorPlayers
to show and hide letters dynamically (like a typewriter), choosing different pauses for any kind of characters (punctuation, letters, [...]), trigger events and more.
You can tell TextAnimator to use the typewriter in two ways.
Replacing "tmproText.text = textValue;
" with textAnimatorPlayer.ShowText(textValue);
in your code (referencing a TextAnimatorPlayer component).
Enabling the "Use Easy Integration
" option in the TextAnimator component.
This will let the plugin automatically check for text changes from your TextMeshPro's component.
You can pause the typewriter at any time by invoking textAnimatorPlayer.StopShowingText(), and you can start/resume it by invoking textAnimatorPlayer.StartShowingText().
You can hide letters dynamically via script, by invoking textAnimatorPlayer.StartDisappearingText(), and you can also stop it at any time by invoking textAnimatorPlayer.StopDisappearingText().
You can create your own typewriter (read here how to create a custom typewriter via C#) or you can use the built-in one.
The default typewriter component is called TextAnimatorPlayer
.
You can hover the mouse above its fields in the Inspector to show the tooltips for each option/feature, but here's a quick look in this page as well.
Use Type Writer
: true if you want to show text dynamically, like a typewriter.
👍🏻 The typewriter timescale will match the relative TextAnimator component one.
Start Typewriter Mode
: tells the typewriter when to start showing letters.
From Script Only: the typerwiter can only be started by invoking TextAnimatorPlayer.StartShowingText().
OnEnable: the typewriter starts every time the gameObject is set active
OnShowText: the typewriter starts as soon as a new text is set (as explained in the "Showing Text" section).
Automatically From All Events: all of the above
Reset Typing Speed At Startup
: true if you want the typewriter's speed to reset back to 1 every time a new text is show, otherwise it will save the last one used.
Can Skip Typewriter
: true if you want to enable the user to skip the typewriter (e.g. by calling TextAnimatorPlayer.SkipTypewriter()).
Hide Appearances On Skip
: true if you want to prevent appearance effects from playing whenever the typewriter skips
Trigger Events On Skip
: true if you want to trigger all remaining events once the typewriter skips
You can trigger events based on the typewriter activity (example: when it just ended showing text).
OnTextShowed
: event called after the entire text has been shown (if you've set "Use Typewriter" to true, it will wait until all letters are shown).
OnTextDisappeared
: called as soon as the script starts hiding the last letter.
The following below only work if the "use typewriter" is set to true:
OnCharacterVisible(char x)
: called each time a character became visible.
OnTypewriterStart
: called right before the typewriter starts showing its first letter.
It doesn't work if the typewriter is off, since it would coincide with the "OnTextShowed" event (in this case you can use that one instead)
Wait for:
Normal chars
: any letter that is not puntuaction.
Long
: '!
', '?
', '.
'
Middle
: ',
', ';
', ')
',':
','-
'
AvoidMultiplePunctuactionWait
If true, only the last punctuation on a sequence waits for its category time. Example: "I'm bored......" → all dots will have a "normal" wait, except for the very last dot of the sequence, which will have a "long" wait.
If false, each punctuation will wait regardless if it's in a sequence or not. Example: "I'm bored......" → each single dot will have a "long" wait
Wait For New Lines
: true if you want the typewriter to wait for "new lines" characters as well, like .
Wait For Last Character
: true if you want to wait for the last character of the text as well (e.g. a dot).
Disappearance Orientation
: The direction that disappearing letters will follow.
Same As Typewriter
: The same direction as the typewriter, e.g. "left to right".
Inverted
: Opposite direction than the typewriter, e.g. if your text is set "left to right", the letters will start disappearing from "right to left".
Use Typewriter Wait Times
: true if you want to have a "disappearance" speed that follows the same rules as the typewriter (e.g. waiting for puntuaction, different types of characters etc.).
if true, you will edit the Typewriter Speed Multiplier
: Multiplies the base typewriter speed (e.g. setting it to "0.5" will start hiding letters twice as slow than they get shown).
if false, you will edit the Disappearances Wait
: Sets a "wait time" for all characters.