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

Yarn Spinner for Godot GDScript 3.3 API Reference

#Core

The virtual machine, program data, variable storage and the other classes that run Yarn programs.

  • Provides assets associated with yarn dialogue lines.
  • YarnAsync class
    Async helpers shared by the runner and presenters.
  • Token for signalling cancellation to async presenters.
  • Binds a Yarn command or function to a method on a node.
  • Parses Yarn command strings with support for quoted arguments and escapes.
  • Yarn Spinner's localisation, built on Godot's own systems: text through TranslationServer (keys are the line ID with translation_prefix prepended), and audio through translation remaps (Project Settings > Localization > Remaps), applied by ResourceLoader. There is no separate Yarn localisation backend.
  • In-memory implementation of variable storage.
  • Represents a single instruction in a yarn node.
  • Manages built-in and custom Yarn Spinner functions and commands. Command arguments are automatically coerced to match parameter types; Node-typed parameters are resolved from the scene tree.
  • YarnLine class
    A line of dialogue with substitution, markup, and localisation support.
  • Provides localised line content for yarn dialogue. Handles text lookup, substitution, and markup parsing.
  • a markup attribute in yarn text, tracking name, position, length, and properties.
  • Wrapper for the bundled native Yarn Spinner compiler. Editor-only — used by the importer to compile .yarn files without requiring the ysc CLI tool or .NET runtime on the user's machine.
  • YarnNode class
    represents a single node in a yarn program. contains the instructions to execute and metadata headers.
  • Yarn numbers are 32-bit floats. Godot floats are 64-bit doubles, so every number needs to be snapped to float32 width and displayed with float32 shortest-round-trip formatting to match the other runtimes.
  • A dialogue option that can be selected by the player.
  • Represents a compiled yarn spinner program.
  • A completion object for the presenter system.
  • Base class for saliency selection strategies.
  • Evaluates smart variables declared in Yarn scripts at runtime.
  • Lightweight static VM for evaluating compiled smart variable bytecode.
  • Base class for variable storage in Yarn Spinner.
  • Stack-based VM that executes compiled Yarn bytecode.
  • generates .ysls.json files for yarn spinner language server integration. scans for YarnCommandBinding resources, _yarn_command_*/_yarn_function_* methods, and registered library commands/functions.

#Main

The Dialogue Runner, Yarn Project resources and the other classes you use most often.

  • Registers Yarn command and function bindings with a dialogue runner. Configure bindings in the inspector to connect Yarn commands to methods on scene nodes.
  • Base class for presenting Yarn dialogue to the player.
  • main controller for yarn spinner dialogue. manages the virtual machine, presenters, and dialogue flow.
  • resource containing a compiled yarn project. created by importing .yarnproject files.
  • resource representing a single .yarn script file. used for editor integration and reference.
  • yarn spinner singleton providing global access and utilities. autoloaded as "YarnSpinner" when the plugin is enabled.

#Markup

Classes for parsing and processing markup in lines.

  • base class for processing replacement markers during parsing. these run at parse-time to modify text (e.g. [select], [plural], [ordinal]). subclass and override process_replacement_marker() for custom markers.
  • marker processor for built-in select, plural, and ordinal replacement markers.
  • extracts character name from [character] markup attributes.
  • Unicode CLDR plural rules (cardinal and ordinal) for the `plural` and `ordinal` markup replacement markers.
  • parses text and produces markup information.
  • base class for processing markup attributes into bbcode.
  • a collection of marker names and formatting styles for the palette processor. supports basic markers (colour, bold, italic, etc.) and custom markers (arbitrary start/end tag strings).
  • parses yarn spinner markup and transforms it using registered processors. uses YarnLineParser internally with a backwards-compatible API.
  • the result of parsing a line of marked-up text. contains plain text (markup tags removed) and attributes describing positions.
  • a named property with a typed value, associated with a markup attribute.
  • parse-time processor that applies bbcode styling from a YarnMarkupPalette. register custom marker names (e.g. [happy], [angry]) mapped to formatting.
  • converts [color] markup attributes to bbcode color tags.
  • display-time handler for [pause] markup tags in typewriter presentation. integers are milliseconds ([pause=500/]), floats are seconds ([pause=0.5/]), no value defaults to 1000ms. self-closing tag marking a point in the text.
  • parse-time processor that converts [style] markup tags to bbcode. supports bold, italic, underline, strikethrough, code, and custom names.
  • converts [style] markup attributes to Godot bbcode.

#UI

Presenters, typewriters and other nodes for showing dialogue on screen.

  • interface for handling markup actions during typewriter presentation. runs at display-time to react to text being revealed (unlike replacement marker processors, which run at parse-time and modify text). subclass and override the methods needed for the desired effect.
  • Node-based base class for display-time action markup handlers.
  • complete dialogue view combining line and options presenters. provides a ready-to-use dialogue ui with no additional setup.
  • reusable animation effects for dialogue presentation.
  • handles input for advancing dialogue lines. separates input handling from presentation.
  • built-in presenter for displaying dialogue lines. provides a typewriter effect, a continue indicator, and a list of YarnActionMarkupHandler event handlers that are invoked as each character is revealed.
  • option button for dialogue choices: plain grey text that turns white with a dot indicator while focused. hovering focuses the button.
  • single option button wrapping a Button with availability state handling.
  • Built-in presenter for displaying dialogue options. Creates buttons for each option and handles selection.
  • presenter that emits signals for all dialogue events. designed for visual scripting tools that connect signals and call methods instead of subclassing presenters.
  • presenter for playing voice over audio associated with dialogue lines. syncs audio playback with text display.

Generated from Yarn Spinner for Godot GDScript 3.3.