class_buttonarray - dragonsoulz/godot GitHub Wiki
ButtonArray
####Inherits: Control ####Category: Core
Brief Description
Array of Buttons.
Member Functions
- void add_button ( String text )
- void add_icon_button ( Object icon, String text="" )
- void set_button_text ( int button, String text )
- void set_button_icon ( int button, Object icon )
- String get_button_text ( int button ) const
- Object get_button_icon ( int button ) const
- int get_button_count ( ) const
- int get_selected ( ) const
- int get_hovered ( ) const
- void set_selected ( int button )
- void erase_button ( int button )
- void clear ( )
Signals
- button_selected ( int button )
Numeric Constants
- ALIGN_BEGIN = 0 - Align buttons at the begining.
- ALIGN_CENTER = 1 - Align buttons in the middle.
- ALIGN_END = 2 - Align buttons at the end.
- ALIGN_FILL = 3 - Spread the buttons, but keep them small.
- ALIGN_EXPAND_FILL = 4 - Spread the buttons, but expand them.
Description
Array of Buttons. A Button array is useful to have an array of buttons laid out vertically or horizontally. Only one can be selected. This is useful for joypad based interfaces and option menus.
Member Function Description
add_button
- void add_button ( String text )
Add a new button.
set_button_icon
Set the icon of an existing button.
get_button_text
Return the text of an existing button.
get_button_icon
Return the icon of an existing button.
get_button_count
- int get_button_count ( ) const
Return the amount of buttons in the array.
get_selected
- int get_selected ( ) const
Return the currently selected button in the array.
get_hovered
- int get_hovered ( ) const
Return the currently hovered button in the array.
set_selected
- void set_selected ( int button )
Sekect a button in the array.
erase_button
- void erase_button ( int button )
Remove a button in the array, by index.
clear
- void clear ( )
Clear the button array.