diff options
Diffstat (limited to 'doc/classes/OptionButton.xml')
-rw-r--r-- | doc/classes/OptionButton.xml | 104 |
1 files changed, 57 insertions, 47 deletions
diff --git a/doc/classes/OptionButton.xml b/doc/classes/OptionButton.xml index a7b1f0ea33..f10c096c1b 100644 --- a/doc/classes/OptionButton.xml +++ b/doc/classes/OptionButton.xml @@ -13,26 +13,26 @@ <methods> <method name="add_icon_item"> <return type="void" /> - <argument index="0" name="texture" type="Texture2D" /> - <argument index="1" name="label" type="String" /> - <argument index="2" name="id" type="int" default="-1" /> + <param index="0" name="texture" type="Texture2D" /> + <param index="1" name="label" type="String" /> + <param index="2" name="id" type="int" default="-1" /> <description> - 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, the item index will be used as the item's ID. New items are appended at the end. + Adds an item, with a [param texture] icon, text [param label] and (optionally) [param id]. If no [param id] is passed, the item index will be used as the item's ID. New items are appended at the end. </description> </method> <method name="add_item"> <return type="void" /> - <argument index="0" name="label" type="String" /> - <argument index="1" name="id" type="int" default="-1" /> + <param index="0" name="label" type="String" /> + <param index="1" name="id" type="int" default="-1" /> <description> - Adds an item, with text [code]label[/code] and (optionally) [code]id[/code]. If no [code]id[/code] is passed, the item index will be used as the item's ID. New items are appended at the end. + Adds an item, with text [param label] and (optionally) [param id]. If no [param id] is passed, the item index will be used as the item's ID. New items are appended at the end. </description> </method> <method name="add_separator"> <return type="void" /> - <argument index="0" name="text" type="String" default="""" /> + <param index="0" name="text" type="String" default="""" /> <description> - Adds a separator to the list of items. Separators help to group items, and can optionally be given a [code]text[/code] header. A separator also gets an index assigned, and is appended at the end of the item list. + Adds a separator to the list of items. Separators help to group items, and can optionally be given a [param text] header. A separator also gets an index assigned, and is appended at the end of the item list. </description> </method> <method name="clear"> @@ -43,44 +43,44 @@ </method> <method name="get_item_icon" qualifiers="const"> <return type="Texture2D" /> - <argument index="0" name="idx" type="int" /> + <param index="0" name="idx" type="int" /> <description> - Returns the icon of the item at index [code]idx[/code]. + Returns the icon of the item at index [param idx]. </description> </method> <method name="get_item_id" qualifiers="const"> <return type="int" /> - <argument index="0" name="idx" type="int" /> + <param index="0" name="idx" type="int" /> <description> - Returns the ID of the item at index [code]idx[/code]. + Returns the ID of the item at index [param idx]. </description> </method> <method name="get_item_index" qualifiers="const"> <return type="int" /> - <argument index="0" name="id" type="int" /> + <param index="0" name="id" type="int" /> <description> - Returns the index of the item with the given [code]id[/code]. + Returns the index of the item with the given [param id]. </description> </method> <method name="get_item_metadata" qualifiers="const"> <return type="Variant" /> - <argument index="0" name="idx" type="int" /> + <param index="0" name="idx" type="int" /> <description> Retrieves the metadata of an item. Metadata may be any type and can be used to store extra information about an item, such as an external string ID. </description> </method> <method name="get_item_text" qualifiers="const"> <return type="String" /> - <argument index="0" name="idx" type="int" /> + <param index="0" name="idx" type="int" /> <description> - Returns the text of the item at index [code]idx[/code]. + Returns the text of the item at index [param idx]. </description> </method> <method name="get_item_tooltip" qualifiers="const"> <return type="String" /> - <argument index="0" name="idx" type="int" /> + <param index="0" name="idx" type="int" /> <description> - Returns the tooltip of the item at index [code]idx[/code]. + Returns the tooltip of the item at index [param idx]. </description> </method> <method name="get_popup" qualifiers="const"> @@ -92,7 +92,7 @@ </method> <method name="get_selectable_item" qualifiers="const"> <return type="int" /> - <argument index="0" name="from_last" type="bool" default="false" /> + <param index="0" name="from_last" type="bool" default="false" /> <description> </description> </method> @@ -115,27 +115,27 @@ </method> <method name="is_item_disabled" qualifiers="const"> <return type="bool" /> - <argument index="0" name="idx" type="int" /> + <param index="0" name="idx" type="int" /> <description> - Returns [code]true[/code] if the item at index [code]idx[/code] is disabled. + Returns [code]true[/code] if the item at index [param idx] is disabled. </description> </method> <method name="is_item_separator" qualifiers="const"> <return type="bool" /> - <argument index="0" name="idx" type="int" /> + <param index="0" name="idx" type="int" /> <description> </description> </method> <method name="remove_item"> <return type="void" /> - <argument index="0" name="idx" type="int" /> + <param index="0" name="idx" type="int" /> <description> - Removes the item at index [code]idx[/code]. + Removes the item at index [param idx]. </description> </method> <method name="select"> <return type="void" /> - <argument index="0" name="idx" type="int" /> + <param index="0" name="idx" type="int" /> <description> Selects an item by index and makes it the current item. This will work even if the item is disabled. Passing [code]-1[/code] as the index deselects any currently selected item. @@ -143,57 +143,61 @@ </method> <method name="set_item_disabled"> <return type="void" /> - <argument index="0" name="idx" type="int" /> - <argument index="1" name="disabled" type="bool" /> + <param index="0" name="idx" type="int" /> + <param index="1" name="disabled" type="bool" /> <description> - Sets whether the item at index [code]idx[/code] is disabled. + Sets whether the item at index [param idx] is disabled. Disabled items are drawn differently in the dropdown and are not selectable by the user. If the current selected item is set as disabled, it will remain selected. </description> </method> <method name="set_item_icon"> <return type="void" /> - <argument index="0" name="idx" type="int" /> - <argument index="1" name="texture" type="Texture2D" /> + <param index="0" name="idx" type="int" /> + <param index="1" name="texture" type="Texture2D" /> <description> - Sets the icon of the item at index [code]idx[/code]. + Sets the icon of the item at index [param idx]. </description> </method> <method name="set_item_id"> <return type="void" /> - <argument index="0" name="idx" type="int" /> - <argument index="1" name="id" type="int" /> + <param index="0" name="idx" type="int" /> + <param index="1" name="id" type="int" /> <description> - Sets the ID of the item at index [code]idx[/code]. + Sets the ID of the item at index [param idx]. </description> </method> <method name="set_item_metadata"> <return type="void" /> - <argument index="0" name="idx" type="int" /> - <argument index="1" name="metadata" type="Variant" /> + <param index="0" name="idx" type="int" /> + <param index="1" name="metadata" type="Variant" /> <description> Sets the metadata of an item. Metadata may be of any type and can be used to store extra information about an item, such as an external string ID. </description> </method> <method name="set_item_text"> <return type="void" /> - <argument index="0" name="idx" type="int" /> - <argument index="1" name="text" type="String" /> + <param index="0" name="idx" type="int" /> + <param index="1" name="text" type="String" /> <description> - Sets the text of the item at index [code]idx[/code]. + Sets the text of the item at index [param idx]. </description> </method> <method name="set_item_tooltip"> <return type="void" /> - <argument index="0" name="idx" type="int" /> - <argument index="1" name="tooltip" type="String" /> + <param index="0" name="idx" type="int" /> + <param index="1" name="tooltip" type="String" /> <description> - Sets the tooltip of the item at index [code]idx[/code]. + Sets the tooltip of the item at index [param idx]. </description> </method> </methods> <members> <member name="action_mode" type="int" setter="set_action_mode" getter="get_action_mode" overrides="BaseButton" enum="BaseButton.ActionMode" default="0" /> <member name="alignment" type="int" setter="set_text_alignment" getter="get_text_alignment" overrides="Button" enum="HorizontalAlignment" default="0" /> + <member name="fit_to_longest_item" type="bool" setter="set_fit_to_longest_item" getter="is_fit_to_longest_item" default="true"> + If [code]true[/code], minimum size will be determined by the longest item's text, instead of the currently selected one's. + [b]Note:[/b] For performance reasons, the minimum size doesn't update immediately when adding, removing or modifying items. + </member> <member name="item_count" type="int" setter="set_item_count" getter="get_item_count" default="0"> The number of items to select from. </member> @@ -204,13 +208,13 @@ </members> <signals> <signal name="item_focused"> - <argument index="0" name="index" type="int" /> + <param index="0" name="index" type="int" /> <description> Emitted when the 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. </description> </signal> <signal name="item_selected"> - <argument index="0" name="index" type="int" /> + <param index="0" name="index" type="int" /> <description> Emitted when the current item has been changed by the user. The index of the item selected is passed as argument. </description> @@ -229,6 +233,9 @@ <theme_item name="font_hover_color" data_type="color" type="Color" default="Color(0.95, 0.95, 0.95, 1)"> Text [Color] used when the [OptionButton] is being hovered. </theme_item> + <theme_item name="font_hover_pressed_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)"> + Text [Color] used when the [OptionButton] is being hovered and pressed. + </theme_item> <theme_item name="font_outline_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)"> The tint of text outline of the [OptionButton]. </theme_item> @@ -239,7 +246,10 @@ The horizontal space between the arrow icon and the right edge of the button. </theme_item> <theme_item name="h_separation" data_type="constant" type="int" default="2"> - The horizontal space between [OptionButton]'s icon and text. + The horizontal space between [OptionButton]'s icon and text. Negative values will be treated as [code]0[/code] when used. + </theme_item> + <theme_item name="modulate_arrow" data_type="constant" type="int" default="0"> + If different than [code]0[/code], the arrow icon will be modulated to the font color. </theme_item> <theme_item name="outline_size" data_type="constant" type="int" default="0"> The size of the text outline. |