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
| Type | Name | Default |
|---|---|---|
| Label | text_display | null |
| RichTextLabel | rich_text_display | null |
| int | option_index | 0 |
Methods
| Return Type | Method |
|---|---|
| String | get_text() |
| void | set_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).
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).
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.