Button control that provides selectable options when pressed.
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.
Adds an item, with a [code]texture[/code] icon, text [code]label[/code] and (optionally) [code]id[/code]. If no [code]id[/code] is passed, [code]id[/code] becomes the item index. New items are appended at the end.
Adds an item, with text [code]label[/code] and (optionally) [code]id[/code]. If no [code]id[/code] is passed, [code]id[/code] becomes the item index. New items are appended at the end.
Adds a separator to the list of items. Separators help to group items. Separator also takes up an index and is appended at the end.
Clear all the items in the [OptionButton].
Returns the amount of items in the OptionButton.
Returns the icon of the item at index [code]idx[/code].
Returns the ID of the item at index [code]idx[/code].
Returns the index of the item with the given [code]id[/code].
Returns the text of the item at index [code]idx[/code].
Returns the [PopupMenu] contained in this button.
Select an item by index and make it the current item.
Sets the icon of an item at index [code]idx[/code].
Sets the ID of an item at index [code]idx[/code].
Sets the text of an item at index [code]idx[/code].
Emitted the when user navigates to an item using the [code]ui_up[/code] or [code]ui_down[/code] actions. The index of the item selected is passed as argument.
Emitted when the current item has been changed by the user. The index of the item selected is passed as argument.