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

YarnMarkupPalette

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).
class_name YarnMarkupPalette
extends Resource

Inherits from Resource

#Nested Types

  • simple formatting with colour, bold, italic, underline, strikethrough.
  • arbitrary start/end tag strings for complex formatting effects.

#Properties

#basic_markers

basic markers stored as dictionaries for inspector editing.
var basic_markers: Array[Dictionary] = []

Type Array[Dictionary]

#custom_markers

custom markers stored as dictionaries for inspector editing.
var custom_markers: Array[Dictionary] = []

Type Array[Dictionary]

#Methods

#add_basic_marker(String, bool, Color, bool, bool, bool, bool)

adds a basic marker at runtime (added to both cache and exported array).
func add_basic_marker(marker_name: String, use_color: bool = false, marker_color: Color = Color(1, 1, 1, 1), bold: bool = false, italic: bool = false, underline: bool = false, strikethrough: bool = false) -> void

Parameters

  • marker_nameString
  • use_colorbool
  • marker_colorColor
  • boldbool
  • italicbool
  • underlinebool
  • strikethroughbool

#add_custom_marker(String, String, String, int, int)

adds a custom marker at runtime (added to both cache and exported array).
func add_custom_marker(marker_name: String, start_tags: String, end_tags: String, offset: int = 0, visible_chars: int = 0) -> void

Parameters

  • marker_nameString
  • start_tagsString
  • end_tagsString
  • offsetint
  • visible_charsint

#color_for_marker(String)

returns {"found": bool, "color": Color} for a marker name.
func color_for_marker(marker_name: String) -> Dictionary

Parameters

  • marker_nameString

Returns Dictionary

#get_all_marker_names()

returns all marker names defined in this palette.
func get_all_marker_names() -> Array[String]

Returns Array[String]

#invalidate_cache()

clears the internal cache, forcing rebuild on next access.
func invalidate_cache() -> void

#palette_for_marker(String)

returns formatting as start/end tags for a marker name. basic markers are converted to bbcode; custom markers return as-is.
func palette_for_marker(marker_name: String) -> Dictionary

Parameters

  • marker_nameString

Returns Dictionary

Generated from Yarn Spinner for Godot GDScript 3.3.