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

YarnMarkupAttribute

a markup attribute in yarn text, tracking name, position, length, and properties.
class_name YarnMarkupAttribute
extends RefCounted

Inherits from RefCounted

#Properties

#length

number of plain text characters this attribute covers.
var length: int = 0

Type int

#name

var name: String = ""

Type String

#position

position in the plain text where this attribute begins.
var position: int = 0

Type int

#properties

name -> YarnMarkupValue
var properties: Dictionary = {}

Type Dictionary

#source_position

position in the original source text.
var source_position: int = 0

Type int

#value

var value: String = ""

Type String

#Methods

#get_property(String, Variant)

func get_property(prop_name: String, default_value: Variant = null) -> Variant

Parameters

  • prop_nameString
  • default_valueVariant

Returns Variant

#has_value()

func has_value() -> bool

Returns bool

#shift(int)

returns a copy with position shifted by amount.
func shift(amount: int) -> YarnMarkupAttribute

Parameters

  • amountint

Returns YarnMarkupAttribute

#try_get_bool_property(String, bool)

func try_get_bool_property(prop_name: String, default_value: bool = false) -> bool

Parameters

  • prop_nameString
  • default_valuebool

Returns bool

#try_get_float_property(String, float)

func try_get_float_property(prop_name: String, default_value: float = 0.0) -> float

Parameters

  • prop_nameString
  • default_valuefloat

Returns float

#try_get_int_property(String, int)

func try_get_int_property(prop_name: String, default_value: int = 0) -> int

Parameters

  • prop_nameString
  • default_valueint

Returns int

#try_get_property(String)

returns YarnMarkupValue for the property name, or null.
func try_get_property(prop_name: String) -> YarnMarkupValue

Parameters

  • prop_nameString

Returns YarnMarkupValue

#try_get_string_property(String, String)

func try_get_string_property(prop_name: String, default_value: String = "") -> String

Parameters

  • prop_nameString
  • default_valueString

Returns String

Generated from Yarn Spinner for Godot GDScript 3.3.