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

YarnLineProvider

Provides localised line content for yarn dialogue. Handles text lookup, substitution, and markup parsing.
class_name YarnLineProvider
extends Resource

Inherits from Resource

#Constants

#INVALID_LINE_ID

const INVALID_LINE_ID = "<missing>"

#INVALID_LINE_TEXT

const INVALID_LINE_TEXT = "!! ERROR: Missing line!"

#Properties

#asset_locale_code

var asset_locale_code: String = ""

Type String

#fallback_locale_code

var fallback_locale_code: String = ""

Type String

#godot_localisation

var godot_localisation: YarnGodotLocalisation

Type YarnGodotLocalisation

#locale

Legacy accessor; prefer get_current_locale()/set_current_locale().
var locale: String

Type String

#text_locale_code

var text_locale_code: String = ""

Type String

#use_fallback

var use_fallback: bool = true

Type bool

#Methods

#add_to_translation_server(String)

func add_to_translation_server(locale_code: String) -> void

Parameters

  • locale_codeString

#clear_shadow_lines()

func clear_shadow_lines() -> void

#deregister_marker_processor(String)

func deregister_marker_processor(attribute_name: String) -> void

Parameters

  • attribute_nameString

#export_for_godot_translation(String)

func export_for_godot_translation(output_path: String) -> int

Parameters

  • output_pathString

Returns int

#get_asset_locale()

func get_asset_locale() -> String

Returns String

#get_available_locales()

func get_available_locales() -> PackedStringArray

Returns PackedStringArray

#get_current_locale()

func get_current_locale() -> String

Returns String

#get_debug_info()

func get_debug_info() -> String

Returns String

#get_localisation()

func get_localisation() -> YarnGodotLocalisation

Returns YarnGodotLocalisation

#get_localised_audio(String)

func get_localised_audio(line_id: String) -> AudioStream

Parameters

  • line_idString

Returns AudioStream

#get_localised_line(YarnLine)

Main entry point for line processing. Fetches localised text, applies substitutions, and parses markup.
func get_localised_line(line: YarnLine) -> bool

Parameters

Returns bool

#get_localised_option(YarnOption)

func get_localised_option(option: YarnOption) -> bool

Parameters

Returns bool

#get_markup_parser()

func get_markup_parser() -> YarnMarkupParser

Returns YarnMarkupParser

#get_shadow_line_source(String)

Returns the ID of the line this line shadows (with its "line:" prefix), or "" if it is not a shadow line. A #shadow:some_id tag is compiled to "shadow:some_id" metadata; the source line's string table key is "line:some_id".
func get_shadow_line_source(line_id: String) -> String

Parameters

  • line_idString

Returns String

#get_translation_prefix()

func get_translation_prefix() -> String

Returns String

#has_locale(String)

func has_locale(locale_code: String) -> bool

Parameters

  • locale_codeString

Returns bool

#has_localised_audio(String)

func has_localised_audio(line_id: String) -> bool

Parameters

  • line_idString

Returns bool

#parse_markup(String, String)

func parse_markup(text: String, locale_code: String) -> YarnMarkupParseResult

Parameters

  • textString
  • locale_codeString

Returns YarnMarkupParseResult

#prepare_for_lines(PackedStringArray)

func prepare_for_lines(line_ids: PackedStringArray) -> void

Parameters

  • line_idsPackedStringArray

#register_bbcode_processor(YarnMarkupAttributeProcessor)

func register_bbcode_processor(processor: YarnMarkupAttributeProcessor) -> void

Parameters

#register_marker_processor(String, YarnAttributeMarkerProcessor)

func register_marker_processor(attribute_name: String, processor: YarnAttributeMarkerProcessor) -> void

Parameters

#register_shadow_line(String, String)

func register_shadow_line(line_id: String, shadow_id: String) -> void

Parameters

  • line_idString
  • shadow_idString

#resolve_source_line_id(String)

func resolve_source_line_id(line_id: String) -> String

Parameters

  • line_idString

Returns String

#set_audio_base_path(String)

Folder of the base-language voice files; localised variants come from Godot translation remaps.
func set_audio_base_path(path: String) -> void

Parameters

  • pathString

#set_current_locale(String)

func set_current_locale(locale_code: String) -> void

Parameters

  • locale_codeString

#set_program(YarnProgram)

func set_program(program: YarnProgram) -> void

Parameters

#set_translation_prefix(String)

func set_translation_prefix(prefix: String) -> void

Parameters

  • prefixString

#unregister_bbcode_processor(YarnMarkupAttributeProcessor)

func unregister_bbcode_processor(processor: YarnMarkupAttributeProcessor) -> void

Parameters

#unregister_shadow_line(String)

func unregister_shadow_line(line_id: String) -> void

Parameters

  • line_idString

Generated from Yarn Spinner for Godot GDScript 3.3.