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.
- YarnActionDiscovery class
- YarnAssetProvider classProvides assets associated with yarn dialogue lines.
- YarnAsync classAsync helpers shared by the runner and presenters.
- YarnCancellationToken classToken for signalling cancellation to async presenters.
- YarnCommandBinding classBinds a Yarn command or function to a method on a node.
- YarnCommandParser classParses Yarn command strings with support for quoted arguments and escapes.
- YarnFormat class
- YarnGodotLocalisation classYarn 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 byResourceLoader. There is no separate Yarn localisation backend. - In-memory implementation of variable storage.
- YarnInstruction classRepresents a single instruction in a yarn node.
- YarnLibrary classManages 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 classA line of dialogue with substitution, markup, and localisation support.
- YarnLineProvider classProvides localised line content for yarn dialogue. Handles text lookup, substitution, and markup parsing.
- YarnMarkupAttribute classa markup attribute in yarn text, tracking name, position, length, and properties.
- YarnNativeCompiler classWrapper 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 classrepresents a single node in a yarn program. contains the instructions to execute and metadata headers.
- YarnNumber classYarn 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.
- YarnOption classA dialogue option that can be selected by the player.
- YarnProgram classRepresents a compiled yarn spinner program.
- YarnPromise classA completion object for the presenter system.
- YarnSaliencyStrategy classBase class for saliency selection strategies.
- Evaluates smart variables declared in Yarn scripts at runtime.
- YarnSmartVariableVM classLightweight static VM for evaluating compiled smart variable bytecode.
- YarnUnicodeNormalization class
- YarnVariableStorage classBase class for variable storage in Yarn Spinner.
- YarnVirtualMachine classStack-based VM that executes compiled Yarn bytecode.
- YarnYSLSGenerator classgenerates .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.
- YarnBindingLoader classRegisters Yarn command and function bindings with a dialogue runner. Configure bindings in the inspector to connect Yarn commands to methods on scene nodes.
- YarnDialoguePresenter classBase class for presenting Yarn dialogue to the player.
- YarnDialogueRunner classmain controller for yarn spinner dialogue. manages the virtual machine, presenters, and dialogue flow.
- YarnProjectResource classresource containing a compiled yarn project. created by importing .yarnproject files.
- YarnScriptResource classresource representing a single .yarn script file. used for editor integration and reference.
- YarnSpinner classyarn 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.
- YarnCldrPluralRules classUnicode CLDR plural rules (cardinal and ordinal) for the `plural` and `ordinal` markup replacement markers.
- YarnLineParser classparses text and produces markup information.
- base class for processing markup attributes into bbcode.
- YarnMarkupPalette classa 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).
- YarnMarkupParser classparses yarn spinner markup and transforms it using registered processors. uses YarnLineParser internally with a backwards-compatible API.
- YarnMarkupParseResult classthe result of parsing a line of marked-up text. contains plain text (markup tags removed) and attributes describing positions.
- YarnMarkupProperty classa named property with a typed value, associated with a markup attribute.
- YarnMarkupValue class
- 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.
- YarnPauseEventProcessor classdisplay-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.
- YarnStyleMarkerProcessor classparse-time processor that converts [style] markup tags to bbcode. supports bold, italic, underline, strikethrough, code, and custom names.
- YarnStyleMarkupProcessor classconverts [style] markup attributes to Godot bbcode.
#UI
Presenters, typewriters and other nodes for showing dialogue on screen.
- YarnActionMarkupHandler classinterface 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.
- YarnDialogueView classcomplete dialogue view combining line and options presenters. provides a ready-to-use dialogue ui with no additional setup.
- YarnEffects classreusable animation effects for dialogue presentation.
- YarnLineAdvancer classhandles input for advancing dialogue lines. separates input handling from presentation.
- YarnLinePresenter classbuilt-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.
- YarnOptionButton classoption button for dialogue choices: plain grey text that turns white with a dot indicator while focused. hovering focuses the button.
- YarnOptionItem classsingle option button wrapping a Button with availability state handling.
- YarnOptionsPresenter classBuilt-in presenter for displaying dialogue options. Creates buttons for each option and handles selection.
- YarnSignalPresenter classpresenter that emits signals for all dialogue events. designed for visual scripting tools that connect signals and call methods instead of subclassing presenters.
- YarnTypewriter class
- YarnVoiceOverPresenter classpresenter for playing voice over audio associated with dialogue lines. syncs audio playback with text display.
Generated from Yarn Spinner for Godot GDScript 3.3.