This contains the source code documentation of the class DialogicNode_ChoiceButton
.
DialogicNode_ChoiceButton
Inherits: Button
This button allows the player to make a choice in the Dialogic system.
Description
When a choice is reached Dialogic will automatically show ChoiceButtons and call their _load_info()[/code] method which will display the choices. You will need to ensure that enough choice buttons are available in the tree to display all choices.
You can extend this node and implement some custom logic by overwriting the _load_info(info:Dictionary)[/code] method.
If you need RichText support, consider adding a RichTextLabel child and setting it as the text_node
.
DialogicChoiceButtons will grab the focus when hovered to avoid a confusing focus style being present for players who use the mouse. To avoid the opposite situation, when the focus is changed by the player and a different button is still hovered the mouse pointer will be moved to the now focused button as well.
Properties
Name | Type | Default |
---|---|---|
choice_index | int | -1 |
sound_pressed | AudioStream | |
sound_hover | AudioStream | |
sound_focus | AudioStream | |
text_node | Node |
Methods
Returns | Method |
---|---|
void | set_choice_text ( new_text : String ) |
Signals
Emitted when the choice is selected. Unless overridden, this is when the button or its shortcut is pressed.
Property Descriptions
Used to identify what choices to put on. If you leave it at -1, choices will be distributed automatically.
Can be set to play this sound when pressed. Requires a sibling DialogicNode_ButtonSound node.
Can be set to play this sound when hovered. Requires a sibling DialogicNode_ButtonSound node.
Can be set to play this sound when focused. Requires a sibling DialogicNode_ButtonSound node.
If set, the text will be set on this node's text
property instead. This can be used to have a custom text rendering child, like a RichTextLabel.
Method Descriptions
func set_choice_text ( new_text
: String ) ⇒ void
Called when the text changes.