-
Notifications
You must be signed in to change notification settings - Fork 20
class_optionbutton
####Inherits: Button ####Category: Core
Button control that provides selectable options when pressed.
- void
add_item
( String label, int id=-1 ) - void
add_icon_item
( Texture texture, String label, int id ) - void
set_item_text
( int idx, String text ) - void
set_item_icon
( int idx, Texture texture ) - void
set_item_disabled
( int idx, bool disabled ) - void
set_item_ID
( int idx, int id ) - void
set_item_metadata
( int idx, var metadata ) -
String
get_item_text
( int idx ) const -
Texture
get_item_icon
( int idx ) const -
int
get_item_ID
( int idx ) const - void
get_item_metadata
( int idx ) const -
bool
is_item_disabled
( int idx ) const -
int
get_item_count
( ) const - void
add_separator
( ) - void
clear
( ) - void
select
( int arg0 ) -
int
get_selected
( ) const -
int
get_selected_ID
( ) const - void
get_selected_metadata
( ) const - void
remove_item
( int idx )
-
item_selected
( int ID )
OptionButton is a type button that provides a selectable list of items when pressed. The item selected becomes the "current" item and is displayed as the button text.
Add an item, with text "label" and (optionally) id. If no "id" is passed, "id" becomes the item index. New items are appended at the end.
Add an item, with a "texture" icon, text "label" and (optionally) id. If no "id" is passed, "id" becomes the item index. New items are appended at the end.
Set the text of an item at index "idx".
Set the icon of an item at index "idx".
Set the ID of an item at index "idx".
Return the text of the item at index "idx".
Return the icon of the item at index "idx".
Return the ID of the item at index "idx".
-
int
get_item_count
( ) const
Return the amount of items in the OptionButton.
- void
add_separator
( )
Add a separator to the list of items. Separators help to group items. Separator also takes up an index and is appended at the end.
- void
clear
( )
Clear all the items in the OptionButton.
- void
select
( int arg0 )
Select an item by index and make it the current item.
-
int
get_selected
( ) const
Return the current item index