2017-09-12 22:42:36 +02:00
<?xml version="1.0" encoding="UTF-8" ?>
2019-04-01 12:33:56 +02:00
<class name= "OptionButton" inherits= "Button" category= "Core" version= "3.2" >
2017-09-12 22:42:36 +02:00
<brief_description >
Button control that provides selectable options when pressed.
</brief_description>
<description >
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.
</description>
<tutorials >
</tutorials>
<methods >
<method name= "add_icon_item" >
<return type= "void" >
</return>
<argument index= "0" name= "texture" type= "Texture" >
</argument>
<argument index= "1" name= "label" type= "String" >
</argument>
2018-05-12 09:38:00 +02:00
<argument index= "2" name= "id" type= "int" default= "-1" >
2017-09-12 22:42:36 +02:00
</argument>
<description >
2019-06-22 01:04:47 +02:00
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.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "add_item" >
<return type= "void" >
</return>
<argument index= "0" name= "label" type= "String" >
</argument>
<argument index= "1" name= "id" type= "int" default= "-1" >
</argument>
<description >
2019-06-22 01:04:47 +02:00
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.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "add_separator" >
<return type= "void" >
</return>
<description >
2019-06-22 01:04:47 +02:00
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.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "clear" >
<return type= "void" >
</return>
<description >
2019-03-29 23:37:35 +01:00
Clear all the items in the [OptionButton].
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "get_item_count" qualifiers= "const" >
<return type= "int" >
</return>
<description >
2019-05-24 04:15:43 +02:00
Returns the amount of items in the OptionButton.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "get_item_icon" qualifiers= "const" >
<return type= "Texture" >
</return>
<argument index= "0" name= "idx" type= "int" >
</argument>
<description >
2019-06-22 01:04:47 +02:00
Returns the icon of the item at index [code]idx[/code].
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "get_item_id" qualifiers= "const" >
<return type= "int" >
</return>
<argument index= "0" name= "idx" type= "int" >
</argument>
<description >
2019-05-24 04:15:43 +02:00
Returns the ID of the item at index [code]idx[/code].
2019-01-28 16:31:24 +01:00
</description>
</method>
2019-02-16 14:40:52 +01:00
<method name= "get_item_index" qualifiers= "const" >
<return type= "int" >
</return>
<argument index= "0" name= "id" type= "int" >
</argument>
<description >
2019-05-24 04:15:43 +02:00
Returns the index of the item with the given [code]id[/code].
2019-02-16 14:40:52 +01:00
</description>
</method>
2017-09-12 22:42:36 +02:00
<method name= "get_item_metadata" qualifiers= "const" >
<return type= "Variant" >
</return>
<argument index= "0" name= "idx" type= "int" >
</argument>
<description >
</description>
</method>
<method name= "get_item_text" qualifiers= "const" >
<return type= "String" >
</return>
<argument index= "0" name= "idx" type= "int" >
</argument>
<description >
2019-06-22 01:04:47 +02:00
Returns the text of the item at index [code]idx[/code].
2017-09-12 22:42:36 +02:00
</description>
</method>
2017-12-25 16:24:10 +01:00
<method name= "get_popup" qualifiers= "const" >
<return type= "PopupMenu" >
</return>
<description >
2019-05-24 04:15:43 +02:00
Returns the [PopupMenu] contained in this button.
2017-12-25 16:24:10 +01:00
</description>
</method>
2017-09-12 22:42:36 +02:00
<method name= "get_selected_id" qualifiers= "const" >
<return type= "int" >
</return>
<description >
</description>
</method>
<method name= "get_selected_metadata" qualifiers= "const" >
<return type= "Variant" >
</return>
<description >
</description>
</method>
<method name= "is_item_disabled" qualifiers= "const" >
<return type= "bool" >
</return>
<argument index= "0" name= "idx" type= "int" >
</argument>
<description >
</description>
</method>
<method name= "remove_item" >
<return type= "void" >
</return>
<argument index= "0" name= "idx" type= "int" >
</argument>
<description >
</description>
</method>
<method name= "select" >
<return type= "void" >
</return>
<argument index= "0" name= "idx" type= "int" >
</argument>
<description >
Select an item by index and make it the current item.
</description>
</method>
<method name= "set_item_disabled" >
<return type= "void" >
</return>
<argument index= "0" name= "idx" type= "int" >
</argument>
<argument index= "1" name= "disabled" type= "bool" >
</argument>
<description >
</description>
</method>
<method name= "set_item_icon" >
<return type= "void" >
</return>
<argument index= "0" name= "idx" type= "int" >
</argument>
<argument index= "1" name= "texture" type= "Texture" >
</argument>
<description >
2019-06-22 01:04:47 +02:00
Sets the icon of an item at index [code]idx[/code].
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "set_item_id" >
<return type= "void" >
</return>
<argument index= "0" name= "idx" type= "int" >
</argument>
<argument index= "1" name= "id" type= "int" >
</argument>
<description >
2019-06-22 01:04:47 +02:00
Sets the ID of an item at index [code]idx[/code].
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "set_item_metadata" >
<return type= "void" >
</return>
<argument index= "0" name= "idx" type= "int" >
</argument>
<argument index= "1" name= "metadata" type= "Variant" >
</argument>
<description >
</description>
</method>
<method name= "set_item_text" >
<return type= "void" >
</return>
<argument index= "0" name= "idx" type= "int" >
</argument>
<argument index= "1" name= "text" type= "String" >
</argument>
<description >
2019-06-22 01:04:47 +02:00
Sets the text of an item at index [code]idx[/code].
2017-09-12 22:42:36 +02:00
</description>
</method>
</methods>
<members >
2019-06-29 12:38:01 +02:00
<member name= "selected" type= "int" setter= "_select_int" getter= "get_selected" default= "-1" >
2017-09-12 22:42:36 +02:00
</member>
</members>
<signals >
2018-04-10 10:12:42 +02:00
<signal name= "item_focused" >
2019-05-15 12:51:58 +02:00
<argument index= "0" name= "id" type= "int" >
2018-04-10 10:12:42 +02:00
</argument>
<description >
2019-06-22 01:04:47 +02:00
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.
2018-04-10 10:12:42 +02:00
</description>
</signal>
2017-09-12 22:42:36 +02:00
<signal name= "item_selected" >
2019-05-15 12:51:58 +02:00
<argument index= "0" name= "id" type= "int" >
2017-09-12 22:42:36 +02:00
</argument>
<description >
2019-06-22 01:04:47 +02:00
Emitted when the current item has been changed by the user. The index of the item selected is passed as argument.
2017-09-12 22:42:36 +02:00
</description>
</signal>
</signals>
<constants >
</constants>
<theme_items >
<theme_item name= "arrow" type= "Texture" >
</theme_item>
2019-06-29 12:38:01 +02:00
<theme_item name= "arrow_margin" type= "int" default= "2" >
2017-09-12 22:42:36 +02:00
</theme_item>
<theme_item name= "disabled" type= "StyleBox" >
</theme_item>
<theme_item name= "focus" type= "StyleBox" >
</theme_item>
<theme_item name= "font" type= "Font" >
</theme_item>
2019-07-09 09:13:00 +02:00
<theme_item name= "font_color" type= "Color" default= "Color( 0.88, 0.88, 0.88, 1 )" >
2017-09-12 22:42:36 +02:00
</theme_item>
2019-06-29 12:38:01 +02:00
<theme_item name= "font_color_disabled" type= "Color" default= "Color( 0.9, 0.9, 0.9, 0.2 )" >
2017-09-12 22:42:36 +02:00
</theme_item>
2019-07-09 09:13:00 +02:00
<theme_item name= "font_color_hover" type= "Color" default= "Color( 0.94, 0.94, 0.94, 1 )" >
2017-09-12 22:42:36 +02:00
</theme_item>
2019-06-29 12:38:01 +02:00
<theme_item name= "font_color_pressed" type= "Color" default= "Color( 1, 1, 1, 1 )" >
2017-09-12 22:42:36 +02:00
</theme_item>
<theme_item name= "hover" type= "StyleBox" >
</theme_item>
2019-06-29 12:38:01 +02:00
<theme_item name= "hseparation" type= "int" default= "2" >
2017-09-12 22:42:36 +02:00
</theme_item>
<theme_item name= "normal" type= "StyleBox" >
</theme_item>
<theme_item name= "pressed" type= "StyleBox" >
</theme_item>
</theme_items>
</class>