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

YarnSignalPresenter

presenter that emits signals for all dialogue events. designed for visual scripting tools that connect signals and call methods instead of subclassing presenters.
class_name YarnSignalPresenter
extends YarnDialoguePresenter

Inherits from YarnDialoguePresenter

add as a child of a YarnDialogueRunner. connect signals to drive dialogue flow. call proceed() and choose_option() to advance.

#Properties

#current_line_data

var current_line_data: Dictionary = {}

Type Dictionary

#current_options_data

var current_options_data: Array = []

Type Array

#include_bbcode

var include_bbcode: bool = true

Type bool

#is_waiting_for_choice

var is_waiting_for_choice: bool = false

Type bool

#is_waiting_for_proceed

var is_waiting_for_proceed: bool = false

Type bool

#Signals

#line_received

line_data keys: text, character_name, line_id, metadata, bbcode_text
signal line_received(line_data: Dictionary)

Parameters

  • line_dataDictionary

#options_received

each element: text, option_index, is_available, line_id, metadata
signal options_received(options_data: Array)

Parameters

  • options_dataArray

#presenter_dialogue_completed

signal presenter_dialogue_completed()

#presenter_dialogue_started

signal presenter_dialogue_started()

#presenter_node_completed

signal presenter_node_completed(node_name: String)

Parameters

  • node_nameString

#presenter_node_started

signal presenter_node_started(node_name: String)

Parameters

  • node_nameString

#Methods

#choose_option(int)

func choose_option(index: int) -> void

Parameters

  • indexint

#get_current_character()

func get_current_character() -> String

Returns String

#get_current_text()

func get_current_text() -> String

Returns String

#get_option_count()

func get_option_count() -> int

Returns int

#get_option_text(int)

func get_option_text(index: int) -> String

Parameters

  • indexint

Returns String

#is_option_available(int)

func is_option_available(index: int) -> bool

Parameters

  • indexint

Returns bool

#on_dialogue_completed()

func on_dialogue_completed() -> void

#on_dialogue_started()

func on_dialogue_started() -> void

#on_node_completed(String)

func on_node_completed(node_name: String) -> void

Parameters

  • node_nameString

#on_node_started(String)

func on_node_started(node_name: String) -> void

Parameters

  • node_nameString

#proceed()

func proceed() -> void

#run_line(YarnLine, YarnCancellationToken)

func run_line(line: YarnLine, token: YarnCancellationToken = null) -> void

Parameters

#run_options(Array[YarnOption], YarnCancellationToken)

func run_options(options: Array[YarnOption], token: YarnCancellationToken = null) -> int

Parameters

Returns int

Generated from Yarn Spinner for Godot GDScript 3.3.