Skip to main content

DialogOption

Inherits: Button

Description

Component that render a dialog option in a DialogBox from Sprouty Dialogs plugin. It extends the Button class to provide a clickable option in the dialog.

You can customize your own dialog options and extend their functionality by inheriting from this class.

Properties

TypeNameDefault
Labeltext_displaynull
RichTextLabelrich_text_displaynull
intoption_index0

Methods

Return TypeMethod
Stringget_text()
voidset_text(text: String)

Signals

signal option_selected(option_index: int)

Emitted when the option is selected.


Property Descriptions

var text_display : Label

Label to display the option text (Optional).

To consider

If you want to use a custom Label to display the option text, assign it to this variable. It should be a child of this node. Otherwise, the option text will be displayed on the button text.


var rich_text_display : RichTextLabel

RichTextLabel to display the option text (Optional).

To consider

If you want to use a custom RichTextLabel to display the option text, assign it to this variable. It should be a child of this node. Otherwise, the option text will be displayed on the button text.


var option_index : int = 0

Index of the option in the dialog.


Method Descriptions

func get_text() -> String

Return the text of the option.


func set_text(text: String) -> void

Set the text of the option.