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

YarnSpinner

yarn spinner singleton providing global access and utilities. autoloaded as "YarnSpinner" when the plugin is enabled.
class_name YarnSpinner
extends Node

Inherits from Node

#Constants

#VERSION

const VERSION = "3.3"

#Methods

#create_dialogue_runner(YarnProjectResource)

func create_dialogue_runner(project: YarnProjectResource = null) -> YarnDialogueRunner

Parameters

Returns YarnDialogueRunner

#get_global_commands()

func get_global_commands() -> Dictionary

Returns Dictionary

#get_global_functions()

func get_global_functions() -> Dictionary

Returns Dictionary

#get_saliency_strategy(String)

func get_saliency_strategy(name: String) -> YarnSaliencyStrategy

Parameters

  • nameString

Returns YarnSaliencyStrategy

#parse_command(String)

Utility: parse a yarn command string into name and arguments.

Returns: {"name": "command_name", "args": ["arg1", "arg2"]}

Supports quoted arguments with spaces: <<give "magic sword">>
func parse_command(command_text: String) -> Dictionary

Parameters

  • command_textString

Returns Dictionary

#register_command(String, Callable)

func register_command(command_name: String, callable: Callable) -> void

Parameters

  • command_nameString
  • callableCallable

#register_function(String, Callable, int)

func register_function(func_name: String, callable: Callable, param_count: int = -1) -> void

Parameters

  • func_nameString
  • callableCallable
  • param_countint

#register_saliency_strategy(String, YarnSaliencyStrategy)

func register_saliency_strategy(name: String, strategy: YarnSaliencyStrategy) -> void

Parameters

#unregister_command(String)

func unregister_command(command_name: String) -> void

Parameters

  • command_nameString

#unregister_function(String)

func unregister_function(func_name: String) -> void

Parameters

  • func_nameString

Generated from Yarn Spinner for Godot GDScript 3.3.