YarnOptionsPresenter
Built-in presenter for displaying dialogue options. Creates buttons for each option and handles selection.
class_name YarnOptionsPresenter
extends YarnDialoguePresenterInherits from YarnDialoguePresenter
When show_last_line is enabled, the most recent dialogue line is shown above the options. The
[lastline] markup tag can be used to truncate the displayed text at that point.#Constants
#LASTLINE_MARKUP
const LASTLINE_MARKUP = "lastline"#Properties
#fade_down_duration
var fade_down_duration: float = 0.1Type float
#fade_up_duration
var fade_up_duration: float = 0.25Type float
#hide_unavailable
Hide options whose is_available is false (instead of showing them greyed out).
var hide_unavailable: bool = trueType bool
#last_line_character_name_container
Container for the character name (hidden when line has no character).
var last_line_character_name_container: ControlType Control
#last_line_character_name_text
Label for the character name of the last line.
var last_line_character_name_text: ControlType Control
#last_line_container
Container holding the last line display (hidden when no last line).
var last_line_container: ControlType Control
#last_line_text
Label or RichTextLabel to display the last line's text. Only used when show_last_line is enabled.
var last_line_text: ControlType Control
#option_action_prefix
Input action prefix for keyboard shortcuts (e.g. "option_" → "option_1", "option_2").
var option_action_prefix: String = ""Type String
#option_button_scene
Scene instantiated per option. The root may be a YarnOptionItem (preferred) or any
BaseButton. Edit the default scene or point this at your own to restyle options.var option_button_scene: PackedScene = <Object>Type PackedScene
#options_container
var options_container: ContainerType Container
#show_last_line
Show the most recent dialogue line above the options.
var show_last_line: bool = falseType bool
#use_fade_effect
fade the panel in and out around the options.
var use_fade_effect: bool = trueType bool
#Signals
#option_selected
#options_shown
#Methods
#on_dialogue_completed()
func on_dialogue_completed() -> void#on_dialogue_started()
func on_dialogue_started() -> void#run_line(YarnLine, YarnCancellationToken)
func run_line(line: YarnLine, _token: YarnCancellationToken = null) -> voidParameters
lineYarnLine_tokenYarnCancellationToken
#run_options(Array[YarnOption], YarnCancellationToken)
func run_options(options: Array[YarnOption], token: YarnCancellationToken = null) -> intParameters
optionsArray[YarnOption]
Returns int
Generated from Yarn Spinner for Godot GDScript 3.3.