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

YarnProjectResource

resource containing a compiled yarn project. created by importing .yarnproject files.
class_name YarnProjectResource
extends Resource

Inherits from Resource

#Properties

#compiled_program

var compiled_program: PackedByteArray = PackedByteArray()

Type PackedByteArray

#diagnostics

var diagnostics: Array = []

Type Array

#enums

enum name -> { "raw_type": "Number" or "String", "description": String, "cases": [{ "name": String, "value": float or String, "description": String }] }
var enums: Dictionary = {}

Type Dictionary

#line_info

var line_info: Dictionary = {}

Type Dictionary

#line_metadata

line_id -> tags array
var line_metadata: Dictionary = {}

Type Dictionary

#source_files

var source_files: PackedStringArray = PackedStringArray()

Type PackedStringArray

#string_table

line_id -> text
var string_table: Dictionary = {}

Type Dictionary

#variable_types

variable name -> type name: "Number", "String", "Bool", or an enum's name
var variable_types: Dictionary = {}

Type Dictionary

#Methods

#clear_cache()

func clear_cache() -> void

#get_enum_case_name(String, Variant)

The name of the case of enum_name whose raw value is value, or an empty string if there isn't one.
func get_enum_case_name(enum_name: String, value: Variant) -> String

Parameters

  • enum_nameString
  • valueVariant

Returns String

#get_enum_cases(String)

The cases of an enum in teh order they're declared. Each gets a Dictionary with "name", "value" and "description". Empty if there's no such enum!
func get_enum_cases(enum_name: String) -> Array

Parameters

  • enum_nameString

Returns Array

#get_enum_value(String, String)

The raw value of case_name in enum_name, or null if the enum or the case doesn't exist.
func get_enum_value(enum_name: String, case_name: String) -> Variant

Parameters

  • enum_nameString
  • case_nameString

Returns Variant

#get_line_ids_for_nodes(PackedStringArray)

func get_line_ids_for_nodes(node_names: PackedStringArray) -> PackedStringArray

Parameters

  • node_namesPackedStringArray

Returns PackedStringArray

#get_node_names()

func get_node_names() -> PackedStringArray

Returns PackedStringArray

#get_program()

func get_program() -> YarnProgram

Returns YarnProgram

#get_variable_type(String)

The declared type of variable_name: "Number", "String", "Bool", or the name of an enum. Empty if the variable isn't declared...
func get_variable_type(variable_name: String) -> String

Parameters

  • variable_nameString

Returns String

#has_enum(String)

Whether the project declares an enum called enum_name.
func has_enum(enum_name: String) -> bool

Parameters

  • enum_nameString

Returns bool

#has_node(String)

func has_node(node_name: String) -> bool

Parameters

  • node_nameString

Returns bool

Generated from Yarn Spinner for Godot GDScript 3.3.