Pardon our dust! Docs for Yarn Spinner for Unity 3.2 and Yarn Spinner for Godot C# are on docs.yarnspinner.dev (the old docs site). Docs for Yarn Spinner for Unity 3.3 (pre-release, out ASAP), Yarn Spinner for Godot GDScript and Yarn Spinner for Unreal Engine (work in progress) are on /docs/ (the new docs site).

IAsyncTypewriter

An object that can handle delivery of a line's text over time.
public interface IAsyncTypewriter

#Properties

#ActionMarkupHandlers

The list of action markup handlers that this typewriter should call out to while typewriting.
public List<IActionMarkupHandler> ActionMarkupHandlers { get; }

Type List

#TextElement

The main text element that the presenter intends the typewriter to work with
public TMP_Text? TextElement { get; set; }

Type Nullable

Most of the time the typewriter is just going to be changing the visible characters so will need this anyways. Is safe to not worry about this if your typewriter has no need of it.

#Methods

#ContentDidDismiss()

Called after the content has been visibly hidden.
public void ContentDidDismiss();
This is the typewriters last chance to do any cleanup that they may need to do before more content or full destruction occurs, will always be called after ContentWillDismiss(). It is the responsibility of the DialoguePresenterBase to only call this after hiding anything that might look weird if state is reset.

#ContentWillDismiss()

Called right before the content will be visibly hidden
public void ContentWillDismiss();

#PrepareForContent(Markup.MarkupParseResult)

Called by the presenter before content has been shown. This gives the typewriter it's chance to do any setup before the content is visibly shown.
public void PrepareForContent(Markup.MarkupParseResult line);

Parameters

#RunTypewriter(Markup.MarkupParseResult, CancellationToken)

Displays the contents of a line over time.
public YarnTask RunTypewriter(Markup.MarkupParseResult line, CancellationToken cancellationToken);

Parameters

  • The line to display.
  • cancellationTokenSystem.Threading.CancellationToken
    A token that indicates that the typewriter effect should be cancelled.

Returns YarnTask: A task that completes when the typewriter effect has finished.

This method is called when a dialogue presenter wants to deliver a line's text. The typewriter should present the text to the user; it may take as long as it needs to do so.

If cancellationToken's System.Threading.CancellationToken.IsCancellationRequested becomes true, the typewriter effect should end early and present the entire contents of line.

Generated from Yarn Spinner for Unity 3.3.