ArrowSelectionButton ​
Inherits: MarginContainer
ArrowSelectionButton - Cyclic selection control with arrow navigation Supports both numeric options (1 to N) and string-based options with display names
Properties ​
int | number_of_options | 1 |
Array[String] | option_labels | [] |
Variables ​
int | current_option | 1: |
Methods ​
void | set_label( number: int ) |
void | set_type_label( label_text: String ) |
void | set_options( labels: Array[String] ) |
void | set_options_from_packed( labels: PackedStringArray ) |
String | get_current_label() |
int | get_current_index() |
void | update_arrow_visibility() |
void | set_selection( index: int ) |
Signals ​
selection_changed( option: int ) ​
Emitted when the option changes.
Property descriptions ​
int number_of_options = 1 ​
How many options there are.
Array[String] option_labels = [] ​
Optional array of display strings for each option If empty, shows numeric values (1, 2, 3...) If populated, shows these strings instead
Variable descriptions ​
int current_option = 1: ​
The option picked now (the first is 1).
Method descriptions ​
void set_label( number: int ) ​
Old way to set the option (use current_option).
void set_type_label( label_text: String ) ​
Set the type label (static label showing what this selector is for) Example: "Hair", "Eyes", "Nose", etc.
void set_options( labels: Array[String] ) ​
Set options from an array of strings Automatically sets number_of_options and option_labels
void set_options_from_packed( labels: PackedStringArray ) ​
Set options from a PackedStringArray (useful for database returns)
String get_current_label() ​
Get the current label text (whether numeric or string)
int get_current_index() ​
Get the current option as 0-indexed (useful for array lookups)
void update_arrow_visibility() ​
Hides the arrows at the first and last option.
void set_selection( index: int ) ​
Moves to the next option.