Skip to content

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 ​

intnumber_of_options1
Array[String]option_labels[]

Variables ​

intcurrent_option1:

Methods ​

voidset_label( number: int )
voidset_type_label( label_text: String )
voidset_options( labels: Array[String] )
voidset_options_from_packed( labels: PackedStringArray )
Stringget_current_label()
intget_current_index()
voidupdate_arrow_visibility()
voidset_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.