Skip to content

Typewriter

The Typewriter makes a text move. It reveals the text letter by letter or word by word, keeps it alive with looping motion while it is on screen, and hides it again, with events for typing sounds and for knowing when a line is done. Its effects are listed in Motion Effects and Tags.

It works on the letters themselves, so it combines with every material effect, with text on a spline and with the warp. The demo’s three dialogue showcases are built on it:

The demo's Visual Novel: a dialogue box typing its line letter by letter
The demo's Comms: an incoming transmission typed out on a radio panel
The demo's RPG Dialogue: a retro dialogue box with the speaker's name on a tab

Select the text and press Add Typewriter on its All In 1 Text Shader component. It is also in Add Component under AllIn1TextShader → Typewriter.

The Typewriter component with its sections closed

What the typewriter does when the scene starts:

OptionWhat happens
RevealPlays the reveal from the start, with the loops running alongside. The default
Show ImmediatelyThe text appears already revealed and the loops start at once. The way to have loops with no visible reveal
NothingWaits until your code calls Play(), Reveal(), RevealImmediate() or Hide()

Loops only run while the typewriter plays, so with Nothing they wait too.

The inspector has three sections, each holding one preset:

  • Reveal Effects play once, as the text appears.
  • Looped Effects repeat for as long as the text is shown, during the reveal too.
  • Hide Effects play once, as the text goes away.
The Default reveal, a looped Vertical Movement while the text is shown, then the hide

A preset is a saved animation you can reuse on any number of texts. Pick one from the dropdown. The built in ones (Default for the reveal, and None in each section) are read only; to change one, press +, which makes an editable copy of the selected preset and selects it. - deletes the selected preset after asking. Texts that used it switch to the first preset in the list the next time you open their inspector.

New presets are saved in the toolkit’s own folder, under AllIn1TextShader/Config/.

SettingWhat it does
Config NameThe name shown in the dropdown
Group TypePer Character animates each letter on its own, Per Word each word as one piece. Per Tags, for loops only, animates the parts of the text marked with tags
Traversal OrderThe order letters or words start in: Left to Right, Right to Left, Center Outward or Outside In
Characters per secondHow fast the reveal or hide moves through the text, from 1 to 200. Shown as Words per second with Per Word
EffectsTick the effects to use. Each has its own Ease Function and settings
Group Type: the same reveal Per Character, then Per Word
Traversal Order: Left to Right, Right to Left, Center Outward and Outside In
Reveal Effects open on an editable preset, with Fade, Scale, Initial Rotation and Offset ticked

The speed above is how quickly one letter starts after another. Each effect’s own Speed is how long that letter’s animation takes. So a fast typewriter with a slow Fade has many letters fading in at once.

Looped presets have no order and no speed: every letter loops at the same time, each starting at its own random point in the cycle.

Looped Effects open, with Shake and Rainbow ticked and no order or speed fields

Use Reveal As Hide Config, on by default, builds the hide from the reveal played backwards: the order is reversed, every effect runs from its To value back to its From value, and its ease is mirrored, so each letter retraces its entrance exactly. A pop in becomes a wind up and shrink away.

Turn it off to pick a separate hide preset. A hide always plays once; it cannot loop.

Reveal and hide effects pick from ten eases: Linear, Ease Out, Ease In, Ease In Out, Back Out (overshoots, then settles), Back In (winds up first), Elastic Out (springs past and rings down), Bounce Out, Steps (four hard steps) and Flicker (blinks on like a tube light). They show in the dropdown with “(Once)” after the name.

The ten eases on a Scale reveal, each shown on its own name, and the hide playing each one mirrored

Looped effects pick from Linear, Bounce 01 and Wave 01, shown with “(Looped)”. All three go out and back, so each cycle ends where it started.

The Preview box at the bottom plays the typewriter without entering play mode. Preview mode picks what to see: Reveal and Hide add a slider that scrubs through the reveal or the hide, and Looped plays the loops. Set it back to None when you are done.

The scrub shows the order and the shape of the effects; each effect’s own Speed only shows in play mode. While a preview is on, the text cannot be edited.

The Preview box set to Reveal: dragging the slider plays the reveal forwards and back

The Events section raises UnityEvents you can wire in the inspector, like a button’s On Click. They fire in play mode.

EventFires when
On Reveal StartedA reveal begins: Reveal(), Show Immediately, Play() on a text not yet revealed, or a reveal timed by the spline
On Character Reveal StartedEach letter as its reveal starts, the right moment for a typing sound. It passes the character and its index in the text
On Reveal CompletedEvery letter has finished every reveal effect. Not fired when a hide interrupts the reveal
On Hide StartedA hide begins: Hide(), HideImmediate(), or a hide timed by the spline
On Hide CompletedEvery letter has finished every hide effect. Not fired when a reveal interrupts the hide
The Events section with its five UnityEvents

On Character Reveal Started fires once per word with Per Word. It does not fire for spaces, which suits typing sounds, nor for Show Immediately or a reveal timed by the spline.

Each event also exists for code, as OnRevealStarted, OnCharacterRevealStarted, OnRevealCompleted, OnHideStarted and OnHideCompleted:

using AllIn1Assets.AllIn1TextShader;
using UnityEngine;
public class DialogueLine : MonoBehaviour
{
[SerializeField] private AllIn1TextTypewriter typewriter;
[SerializeField] private AudioSource typingSound;
private void OnEnable()
{
typewriter.OnCharacterRevealStarted += OnLetter;
typewriter.OnRevealCompleted += OnLineDone;
}
private void OnDisable()
{
typewriter.OnCharacterRevealStarted -= OnLetter;
typewriter.OnRevealCompleted -= OnLineDone;
}
private void OnLetter(char character, int index)
{
typingSound.Play();
}
private void OnLineDone()
{
Debug.Log("Line finished, show the next button");
}
}

A listener can call Reveal(), Hide() or SetText() on the same typewriter safely: the events fire after the frame’s update, so the next line starts cleanly.

The calls you will use most:

CallWhat it does
SetText(string)Changes the text, tags included, and restarts the reveal
Reveal()Plays the reveal from the start
RevealImmediate()Shows the whole text at once, loops running
Hide()Plays the hide
Pause(), Resume()Freeze and continue
IsRevealed(), IsHidden()Whether the reveal or the hide has finished

Change the text with SetText() rather than through the TextMeshPro component, so tags are read and the letters are regrouped. The full list is in Scripting.

  • It follows Time.timeScale, so it pauses with the game.
  • Characters from another font asset (a fallback font, a bold typeface, a <sprite>) do not take part: they show from the first frame and are not hidden. The text’s component warns when it has any. See Troubleshooting.
  • Material effects keep running on letters as they reveal, so a glow or a shine is already there as each letter arrives.