> For the complete documentation index, see [llms.txt](https://docs.febucci.com/text-animator-unity/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.febucci.com/text-animator-unity/1.x/typewriter/text-animator-players.md).

# Text Animator Players

> *You're reading the documentation of an older/legacy version, Text Animator 1.X.  To read the latest version, please visit this page instead* [2.X (EN)](https://docs.febucci.com/text-animator-unity/2.x/)*. How to update:* [Upgrading from 1.X to 2.X](/text-animator-unity/2.x/other/changelog/upgrading-from-1.x-to-2.x.md)

***

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.

***

## Showing Text

You can tell TextAnimator to use the typewriter in two ways.

### A) Via Code (Recommended)

Replacing "`tmproText.text = textValue;`" with `textAnimatorPlayer.ShowText(textValue);` in your code (*referencing a TextAnimatorPlayer component*).

### B) Via the "Easy Integration"

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.

### Extra Methods

You can pause the typewriter at any time by invoking textAnimatorPlayer.StopShowingText(), and you can start/resume it by invoking textAnimatorPlayer.StartShowingText().

***

## Hiding Text

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.

## Built-in typewriter (TextAnimatorPlayer.cs)

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.

***

### Typewriter Settings

* `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](broken://pages/SNcOzVP8n7QDo9vMQIUQ)).
  * **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

***

### Events

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)*

***

### Set different pauses

* 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).

***

### Disappearances

* `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.
