:github_url: hide .. DO NOT EDIT THIS FILE!!! .. Generated automatically from Godot engine sources. .. Generator: https://github.com/godotengine/godot/tree/4.0/doc/tools/make_rst.py. .. XML source: https://github.com/godotengine/godot/tree/4.0/doc/classes/OptionButton.xml. .. _class_OptionButton: OptionButton ============ **Inherits:** :ref:`Button` **<** :ref:`BaseButton` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` A button that brings up a dropdown with selectable options when pressed. .. rst-class:: classref-introduction-group Description ----------- **OptionButton** is a type of button that brings up a dropdown with selectable items when pressed. The item selected becomes the "current" item and is displayed as the button text. See also :ref:`BaseButton` which contains common properties and methods associated with this node. \ **Note:** Properties :ref:`Button.text` and :ref:`Button.icon` are automatically set based on the selected item. They shouldn't be changed manually. \ **Note:** The ID values used for items are limited to 32 bits, not full 64 bits of :ref:`int`. This has a range of ``-2^32`` to ``2^32 - 1``, i.e. ``-2147483648`` to ``2147483647``. \ **Note:** The ID values used for items are 32-bit, unlike :ref:`int` which is always 64-bit. They go from ``-2147483648`` to ``2147483647``. \ **Note:** The :ref:`Button.text` and :ref:`Button.icon` properties are set automatically based on the selected item. They shouldn't be changed manually. .. rst-class:: classref-reftable-group Properties ---------- .. table:: :widths: auto +-------------------------------------------------------------------+-----------------------------------------------------------------------------+-------------------------------------------------------------------------------+ | :ref:`ActionMode` | action_mode | ``0`` (overrides :ref:`BaseButton`) | +-------------------------------------------------------------------+-----------------------------------------------------------------------------+-------------------------------------------------------------------------------+ | :ref:`HorizontalAlignment` | alignment | ``0`` (overrides :ref:`Button`) | +-------------------------------------------------------------------+-----------------------------------------------------------------------------+-------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`fit_to_longest_item` | ``true`` | +-------------------------------------------------------------------+-----------------------------------------------------------------------------+-------------------------------------------------------------------------------+ | :ref:`int` | :ref:`item_count` | ``0`` | +-------------------------------------------------------------------+-----------------------------------------------------------------------------+-------------------------------------------------------------------------------+ | :ref:`int` | :ref:`selected` | ``-1`` | +-------------------------------------------------------------------+-----------------------------------------------------------------------------+-------------------------------------------------------------------------------+ | :ref:`bool` | toggle_mode | ``true`` (overrides :ref:`BaseButton`) | +-------------------------------------------------------------------+-----------------------------------------------------------------------------+-------------------------------------------------------------------------------+ .. rst-class:: classref-reftable-group Methods ------- .. table:: :widths: auto +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`add_icon_item` **(** :ref:`Texture2D` texture, :ref:`String` label, :ref:`int` id=-1 **)** | +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`add_item` **(** :ref:`String` label, :ref:`int` id=-1 **)** | +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`add_separator` **(** :ref:`String` text="" **)** | +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`clear` **(** **)** | +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Texture2D` | :ref:`get_item_icon` **(** :ref:`int` idx **)** |const| | +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_item_id` **(** :ref:`int` idx **)** |const| | +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_item_index` **(** :ref:`int` id **)** |const| | +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Variant` | :ref:`get_item_metadata` **(** :ref:`int` idx **)** |const| | +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_item_text` **(** :ref:`int` idx **)** |const| | +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_item_tooltip` **(** :ref:`int` idx **)** |const| | +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`PopupMenu` | :ref:`get_popup` **(** **)** |const| | +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_selectable_item` **(** :ref:`bool` from_last=false **)** |const| | +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_selected_id` **(** **)** |const| | +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Variant` | :ref:`get_selected_metadata` **(** **)** |const| | +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_selectable_items` **(** **)** |const| | +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_item_disabled` **(** :ref:`int` idx **)** |const| | +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_item_separator` **(** :ref:`int` idx **)** |const| | +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`remove_item` **(** :ref:`int` idx **)** | +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`select` **(** :ref:`int` idx **)** | +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_item_disabled` **(** :ref:`int` idx, :ref:`bool` disabled **)** | +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_item_icon` **(** :ref:`int` idx, :ref:`Texture2D` texture **)** | +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_item_id` **(** :ref:`int` idx, :ref:`int` id **)** | +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_item_metadata` **(** :ref:`int` idx, :ref:`Variant` metadata **)** | +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_item_text` **(** :ref:`int` idx, :ref:`String` text **)** | +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_item_tooltip` **(** :ref:`int` idx, :ref:`String` tooltip **)** | +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`show_popup` **(** **)** | +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-reftable-group Theme Properties ---------------- .. table:: :widths: auto +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`Color` | :ref:`font_color` | ``Color(0.875, 0.875, 0.875, 1)`` | +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`Color` | :ref:`font_disabled_color` | ``Color(0.875, 0.875, 0.875, 0.5)`` | +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`Color` | :ref:`font_focus_color` | ``Color(0.95, 0.95, 0.95, 1)`` | +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`Color` | :ref:`font_hover_color` | ``Color(0.95, 0.95, 0.95, 1)`` | +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`Color` | :ref:`font_hover_pressed_color` | ``Color(1, 1, 1, 1)`` | +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`Color` | :ref:`font_outline_color` | ``Color(1, 1, 1, 1)`` | +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`Color` | :ref:`font_pressed_color` | ``Color(1, 1, 1, 1)`` | +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`int` | :ref:`arrow_margin` | ``4`` | +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`int` | :ref:`h_separation` | ``2`` | +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`int` | :ref:`modulate_arrow` | ``0`` | +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`int` | :ref:`outline_size` | ``0`` | +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`Font` | :ref:`font` | | +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`int` | :ref:`font_size` | | +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`Texture2D` | :ref:`arrow` | | +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`StyleBox` | :ref:`disabled` | | +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`StyleBox` | :ref:`disabled_mirrored` | | +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`StyleBox` | :ref:`focus` | | +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`StyleBox` | :ref:`hover` | | +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`StyleBox` | :ref:`hover_mirrored` | | +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`StyleBox` | :ref:`normal` | | +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`StyleBox` | :ref:`normal_mirrored` | | +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`StyleBox` | :ref:`pressed` | | +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ | :ref:`StyleBox` | :ref:`pressed_mirrored` | | +-----------------------------------+------------------------------------------------------------------------------------------+-------------------------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Signals ------- .. _class_OptionButton_signal_item_focused: .. rst-class:: classref-signal **item_focused** **(** :ref:`int` index **)** Emitted when the user navigates to an item using the :ref:`ProjectSettings.input/ui_up` or :ref:`ProjectSettings.input/ui_down` input actions. The index of the item selected is passed as argument. .. rst-class:: classref-item-separator ---- .. _class_OptionButton_signal_item_selected: .. rst-class:: classref-signal **item_selected** **(** :ref:`int` index **)** Emitted when the current item has been changed by the user. The index of the item selected is passed as argument. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Property Descriptions --------------------- .. _class_OptionButton_property_fit_to_longest_item: .. rst-class:: classref-property :ref:`bool` **fit_to_longest_item** = ``true`` .. rst-class:: classref-property-setget - void **set_fit_to_longest_item** **(** :ref:`bool` value **)** - :ref:`bool` **is_fit_to_longest_item** **(** **)** If ``true``, minimum size will be determined by the longest item's text, instead of the currently selected one's. \ **Note:** For performance reasons, the minimum size doesn't update immediately when adding, removing or modifying items. .. rst-class:: classref-item-separator ---- .. _class_OptionButton_property_item_count: .. rst-class:: classref-property :ref:`int` **item_count** = ``0`` .. rst-class:: classref-property-setget - void **set_item_count** **(** :ref:`int` value **)** - :ref:`int` **get_item_count** **(** **)** The number of items to select from. .. rst-class:: classref-item-separator ---- .. _class_OptionButton_property_selected: .. rst-class:: classref-property :ref:`int` **selected** = ``-1`` .. rst-class:: classref-property-setget - :ref:`int` **get_selected** **(** **)** The index of the currently selected item, or ``-1`` if no item is selected. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Method Descriptions ------------------- .. _class_OptionButton_method_add_icon_item: .. rst-class:: classref-method void **add_icon_item** **(** :ref:`Texture2D` texture, :ref:`String` label, :ref:`int` id=-1 **)** Adds an item, with a ``texture`` icon, text ``label`` and (optionally) ``id``. If no ``id`` is passed, the item index will be used as the item's ID. New items are appended at the end. .. rst-class:: classref-item-separator ---- .. _class_OptionButton_method_add_item: .. rst-class:: classref-method void **add_item** **(** :ref:`String` label, :ref:`int` id=-1 **)** Adds an item, with text ``label`` and (optionally) ``id``. If no ``id`` is passed, the item index will be used as the item's ID. New items are appended at the end. .. rst-class:: classref-item-separator ---- .. _class_OptionButton_method_add_separator: .. rst-class:: classref-method void **add_separator** **(** :ref:`String` text="" **)** Adds a separator to the list of items. Separators help to group items, and can optionally be given a ``text`` header. A separator also gets an index assigned, and is appended at the end of the item list. .. rst-class:: classref-item-separator ---- .. _class_OptionButton_method_clear: .. rst-class:: classref-method void **clear** **(** **)** Clears all the items in the **OptionButton**. .. rst-class:: classref-item-separator ---- .. _class_OptionButton_method_get_item_icon: .. rst-class:: classref-method :ref:`Texture2D` **get_item_icon** **(** :ref:`int` idx **)** |const| Returns the icon of the item at index ``idx``. .. rst-class:: classref-item-separator ---- .. _class_OptionButton_method_get_item_id: .. rst-class:: classref-method :ref:`int` **get_item_id** **(** :ref:`int` idx **)** |const| Returns the ID of the item at index ``idx``. .. rst-class:: classref-item-separator ---- .. _class_OptionButton_method_get_item_index: .. rst-class:: classref-method :ref:`int` **get_item_index** **(** :ref:`int` id **)** |const| Returns the index of the item with the given ``id``. .. rst-class:: classref-item-separator ---- .. _class_OptionButton_method_get_item_metadata: .. rst-class:: classref-method :ref:`Variant` **get_item_metadata** **(** :ref:`int` idx **)** |const| 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. .. rst-class:: classref-item-separator ---- .. _class_OptionButton_method_get_item_text: .. rst-class:: classref-method :ref:`String` **get_item_text** **(** :ref:`int` idx **)** |const| Returns the text of the item at index ``idx``. .. rst-class:: classref-item-separator ---- .. _class_OptionButton_method_get_item_tooltip: .. rst-class:: classref-method :ref:`String` **get_item_tooltip** **(** :ref:`int` idx **)** |const| Returns the tooltip of the item at index ``idx``. .. rst-class:: classref-item-separator ---- .. _class_OptionButton_method_get_popup: .. rst-class:: classref-method :ref:`PopupMenu` **get_popup** **(** **)** |const| Returns the :ref:`PopupMenu` contained in this button. \ **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their :ref:`Window.visible` property. .. rst-class:: classref-item-separator ---- .. _class_OptionButton_method_get_selectable_item: .. rst-class:: classref-method :ref:`int` **get_selectable_item** **(** :ref:`bool` from_last=false **)** |const| Returns the index of the first item which is not disabled, or marked as a separator. If ``from_last`` is ``true``, the items will be searched in reverse order. Returns ``-1`` if no item is found. .. rst-class:: classref-item-separator ---- .. _class_OptionButton_method_get_selected_id: .. rst-class:: classref-method :ref:`int` **get_selected_id** **(** **)** |const| Returns the ID of the selected item, or ``-1`` if no item is selected. .. rst-class:: classref-item-separator ---- .. _class_OptionButton_method_get_selected_metadata: .. rst-class:: classref-method :ref:`Variant` **get_selected_metadata** **(** **)** |const| Gets the metadata of the selected item. Metadata for items can be set using :ref:`set_item_metadata`. .. rst-class:: classref-item-separator ---- .. _class_OptionButton_method_has_selectable_items: .. rst-class:: classref-method :ref:`bool` **has_selectable_items** **(** **)** |const| Returns ``true`` if this button contains at least one item which is not disabled, or marked as a separator. .. rst-class:: classref-item-separator ---- .. _class_OptionButton_method_is_item_disabled: .. rst-class:: classref-method :ref:`bool` **is_item_disabled** **(** :ref:`int` idx **)** |const| Returns ``true`` if the item at index ``idx`` is disabled. .. rst-class:: classref-item-separator ---- .. _class_OptionButton_method_is_item_separator: .. rst-class:: classref-method :ref:`bool` **is_item_separator** **(** :ref:`int` idx **)** |const| Returns ``true`` if the item at index ``idx`` is marked as a separator. .. rst-class:: classref-item-separator ---- .. _class_OptionButton_method_remove_item: .. rst-class:: classref-method void **remove_item** **(** :ref:`int` idx **)** Removes the item at index ``idx``. .. rst-class:: classref-item-separator ---- .. _class_OptionButton_method_select: .. rst-class:: classref-method void **select** **(** :ref:`int` idx **)** Selects an item by index and makes it the current item. This will work even if the item is disabled. Passing ``-1`` as the index deselects any currently selected item. .. rst-class:: classref-item-separator ---- .. _class_OptionButton_method_set_item_disabled: .. rst-class:: classref-method void **set_item_disabled** **(** :ref:`int` idx, :ref:`bool` disabled **)** Sets whether the item at index ``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. .. rst-class:: classref-item-separator ---- .. _class_OptionButton_method_set_item_icon: .. rst-class:: classref-method void **set_item_icon** **(** :ref:`int` idx, :ref:`Texture2D` texture **)** Sets the icon of the item at index ``idx``. .. rst-class:: classref-item-separator ---- .. _class_OptionButton_method_set_item_id: .. rst-class:: classref-method void **set_item_id** **(** :ref:`int` idx, :ref:`int` id **)** Sets the ID of the item at index ``idx``. .. rst-class:: classref-item-separator ---- .. _class_OptionButton_method_set_item_metadata: .. rst-class:: classref-method void **set_item_metadata** **(** :ref:`int` idx, :ref:`Variant` metadata **)** 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. .. rst-class:: classref-item-separator ---- .. _class_OptionButton_method_set_item_text: .. rst-class:: classref-method void **set_item_text** **(** :ref:`int` idx, :ref:`String` text **)** Sets the text of the item at index ``idx``. .. rst-class:: classref-item-separator ---- .. _class_OptionButton_method_set_item_tooltip: .. rst-class:: classref-method void **set_item_tooltip** **(** :ref:`int` idx, :ref:`String` tooltip **)** Sets the tooltip of the item at index ``idx``. .. rst-class:: classref-item-separator ---- .. _class_OptionButton_method_show_popup: .. rst-class:: classref-method void **show_popup** **(** **)** Adjusts popup position and sizing for the **OptionButton**, then shows the :ref:`PopupMenu`. Prefer this over using ``get_popup().popup()``. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Theme Property Descriptions --------------------------- .. _class_OptionButton_theme_color_font_color: .. rst-class:: classref-themeproperty :ref:`Color` **font_color** = ``Color(0.875, 0.875, 0.875, 1)`` Default text :ref:`Color` of the **OptionButton**. .. rst-class:: classref-item-separator ---- .. _class_OptionButton_theme_color_font_disabled_color: .. rst-class:: classref-themeproperty :ref:`Color` **font_disabled_color** = ``Color(0.875, 0.875, 0.875, 0.5)`` Text :ref:`Color` used when the **OptionButton** is disabled. .. rst-class:: classref-item-separator ---- .. _class_OptionButton_theme_color_font_focus_color: .. rst-class:: classref-themeproperty :ref:`Color` **font_focus_color** = ``Color(0.95, 0.95, 0.95, 1)`` Text :ref:`Color` used when the **OptionButton** is focused. Only replaces the normal text color of the button. Disabled, hovered, and pressed states take precedence over this color. .. rst-class:: classref-item-separator ---- .. _class_OptionButton_theme_color_font_hover_color: .. rst-class:: classref-themeproperty :ref:`Color` **font_hover_color** = ``Color(0.95, 0.95, 0.95, 1)`` Text :ref:`Color` used when the **OptionButton** is being hovered. .. rst-class:: classref-item-separator ---- .. _class_OptionButton_theme_color_font_hover_pressed_color: .. rst-class:: classref-themeproperty :ref:`Color` **font_hover_pressed_color** = ``Color(1, 1, 1, 1)`` Text :ref:`Color` used when the **OptionButton** is being hovered and pressed. .. rst-class:: classref-item-separator ---- .. _class_OptionButton_theme_color_font_outline_color: .. rst-class:: classref-themeproperty :ref:`Color` **font_outline_color** = ``Color(1, 1, 1, 1)`` The tint of text outline of the **OptionButton**. .. rst-class:: classref-item-separator ---- .. _class_OptionButton_theme_color_font_pressed_color: .. rst-class:: classref-themeproperty :ref:`Color` **font_pressed_color** = ``Color(1, 1, 1, 1)`` Text :ref:`Color` used when the **OptionButton** is being pressed. .. rst-class:: classref-item-separator ---- .. _class_OptionButton_theme_constant_arrow_margin: .. rst-class:: classref-themeproperty :ref:`int` **arrow_margin** = ``4`` The horizontal space between the arrow icon and the right edge of the button. .. rst-class:: classref-item-separator ---- .. _class_OptionButton_theme_constant_h_separation: .. rst-class:: classref-themeproperty :ref:`int` **h_separation** = ``2`` The horizontal space between **OptionButton**'s icon and text. Negative values will be treated as ``0`` when used. .. rst-class:: classref-item-separator ---- .. _class_OptionButton_theme_constant_modulate_arrow: .. rst-class:: classref-themeproperty :ref:`int` **modulate_arrow** = ``0`` If different than ``0``, the arrow icon will be modulated to the font color. .. rst-class:: classref-item-separator ---- .. _class_OptionButton_theme_constant_outline_size: .. rst-class:: classref-themeproperty :ref:`int` **outline_size** = ``0`` The size of the text outline. \ **Note:** If using a font with :ref:`FontFile.multichannel_signed_distance_field` enabled, its :ref:`FontFile.msdf_pixel_range` must be set to at least *twice* the value of :ref:`outline_size` for outline rendering to look correct. Otherwise, the outline may appear to be cut off earlier than intended. .. rst-class:: classref-item-separator ---- .. _class_OptionButton_theme_font_font: .. rst-class:: classref-themeproperty :ref:`Font` **font** :ref:`Font` of the **OptionButton**'s text. .. rst-class:: classref-item-separator ---- .. _class_OptionButton_theme_font_size_font_size: .. rst-class:: classref-themeproperty :ref:`int` **font_size** Font size of the **OptionButton**'s text. .. rst-class:: classref-item-separator ---- .. _class_OptionButton_theme_icon_arrow: .. rst-class:: classref-themeproperty :ref:`Texture2D` **arrow** The arrow icon to be drawn on the right end of the button. .. rst-class:: classref-item-separator ---- .. _class_OptionButton_theme_style_disabled: .. rst-class:: classref-themeproperty :ref:`StyleBox` **disabled** :ref:`StyleBox` used when the **OptionButton** is disabled (for left-to-right layouts). .. rst-class:: classref-item-separator ---- .. _class_OptionButton_theme_style_disabled_mirrored: .. rst-class:: classref-themeproperty :ref:`StyleBox` **disabled_mirrored** :ref:`StyleBox` used when the **OptionButton** is disabled (for right-to-left layouts). .. rst-class:: classref-item-separator ---- .. _class_OptionButton_theme_style_focus: .. rst-class:: classref-themeproperty :ref:`StyleBox` **focus** :ref:`StyleBox` used when the **OptionButton** is focused. The ``focus`` :ref:`StyleBox` is displayed *over* the base :ref:`StyleBox`, so a partially transparent :ref:`StyleBox` should be used to ensure the base :ref:`StyleBox` remains visible. A :ref:`StyleBox` that represents an outline or an underline works well for this purpose. To disable the focus visual effect, assign a :ref:`StyleBoxEmpty` resource. Note that disabling the focus visual effect will harm keyboard/controller navigation usability, so this is not recommended for accessibility reasons. .. rst-class:: classref-item-separator ---- .. _class_OptionButton_theme_style_hover: .. rst-class:: classref-themeproperty :ref:`StyleBox` **hover** :ref:`StyleBox` used when the **OptionButton** is being hovered (for left-to-right layouts). .. rst-class:: classref-item-separator ---- .. _class_OptionButton_theme_style_hover_mirrored: .. rst-class:: classref-themeproperty :ref:`StyleBox` **hover_mirrored** :ref:`StyleBox` used when the **OptionButton** is being hovered (for right-to-left layouts). .. rst-class:: classref-item-separator ---- .. _class_OptionButton_theme_style_normal: .. rst-class:: classref-themeproperty :ref:`StyleBox` **normal** Default :ref:`StyleBox` for the **OptionButton** (for left-to-right layouts). .. rst-class:: classref-item-separator ---- .. _class_OptionButton_theme_style_normal_mirrored: .. rst-class:: classref-themeproperty :ref:`StyleBox` **normal_mirrored** Default :ref:`StyleBox` for the **OptionButton** (for right-to-left layouts). .. rst-class:: classref-item-separator ---- .. _class_OptionButton_theme_style_pressed: .. rst-class:: classref-themeproperty :ref:`StyleBox` **pressed** :ref:`StyleBox` used when the **OptionButton** is being pressed (for left-to-right layouts). .. rst-class:: classref-item-separator ---- .. _class_OptionButton_theme_style_pressed_mirrored: .. rst-class:: classref-themeproperty :ref:`StyleBox` **pressed_mirrored** :ref:`StyleBox` used when the **OptionButton** is being pressed (for right-to-left layouts). .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`