class_optionbutton.rst 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/OptionButton.xml.
  6. .. _class_OptionButton:
  7. OptionButton
  8. ============
  9. **Inherits:** :ref:`Button<class_Button>` **<** :ref:`BaseButton<class_BaseButton>` **<** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. Button control that provides selectable options when pressed.
  11. Description
  12. -----------
  13. 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.
  14. See also :ref:`BaseButton<class_BaseButton>` which contains common properties and methods associated with this node.
  15. \ **Note:** Properties :ref:`Button.text<class_Button_property_text>` and :ref:`Button.icon<class_Button_property_icon>` are automatically set based on the selected item. They shouldn't be changed manually.
  16. Properties
  17. ----------
  18. +-------------------------------------------------------------------+-----------------------------------------------------------+-------------------------------------------------------------------------------+
  19. | :ref:`ActionMode<enum_BaseButton_ActionMode>` | action_mode | ``0`` (overrides :ref:`BaseButton<class_BaseButton_property_action_mode>`) |
  20. +-------------------------------------------------------------------+-----------------------------------------------------------+-------------------------------------------------------------------------------+
  21. | :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` | alignment | ``0`` (overrides :ref:`Button<class_Button_property_alignment>`) |
  22. +-------------------------------------------------------------------+-----------------------------------------------------------+-------------------------------------------------------------------------------+
  23. | :ref:`int<class_int>` | :ref:`item_count<class_OptionButton_property_item_count>` | ``0`` |
  24. +-------------------------------------------------------------------+-----------------------------------------------------------+-------------------------------------------------------------------------------+
  25. | :ref:`int<class_int>` | :ref:`selected<class_OptionButton_property_selected>` | ``-1`` |
  26. +-------------------------------------------------------------------+-----------------------------------------------------------+-------------------------------------------------------------------------------+
  27. | :ref:`bool<class_bool>` | toggle_mode | ``true`` (overrides :ref:`BaseButton<class_BaseButton_property_toggle_mode>`) |
  28. +-------------------------------------------------------------------+-----------------------------------------------------------+-------------------------------------------------------------------------------+
  29. Methods
  30. -------
  31. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  32. | void | :ref:`add_icon_item<class_OptionButton_method_add_icon_item>` **(** :ref:`Texture2D<class_Texture2D>` texture, :ref:`String<class_String>` label, :ref:`int<class_int>` id=-1 **)** |
  33. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  34. | void | :ref:`add_item<class_OptionButton_method_add_item>` **(** :ref:`String<class_String>` label, :ref:`int<class_int>` id=-1 **)** |
  35. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  36. | void | :ref:`add_separator<class_OptionButton_method_add_separator>` **(** :ref:`String<class_String>` text="" **)** |
  37. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  38. | void | :ref:`clear<class_OptionButton_method_clear>` **(** **)** |
  39. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  40. | :ref:`Texture2D<class_Texture2D>` | :ref:`get_item_icon<class_OptionButton_method_get_item_icon>` **(** :ref:`int<class_int>` idx **)** |const| |
  41. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  42. | :ref:`int<class_int>` | :ref:`get_item_id<class_OptionButton_method_get_item_id>` **(** :ref:`int<class_int>` idx **)** |const| |
  43. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  44. | :ref:`int<class_int>` | :ref:`get_item_index<class_OptionButton_method_get_item_index>` **(** :ref:`int<class_int>` id **)** |const| |
  45. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  46. | :ref:`Variant<class_Variant>` | :ref:`get_item_metadata<class_OptionButton_method_get_item_metadata>` **(** :ref:`int<class_int>` idx **)** |const| |
  47. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  48. | :ref:`String<class_String>` | :ref:`get_item_text<class_OptionButton_method_get_item_text>` **(** :ref:`int<class_int>` idx **)** |const| |
  49. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  50. | :ref:`String<class_String>` | :ref:`get_item_tooltip<class_OptionButton_method_get_item_tooltip>` **(** :ref:`int<class_int>` idx **)** |const| |
  51. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  52. | :ref:`PopupMenu<class_PopupMenu>` | :ref:`get_popup<class_OptionButton_method_get_popup>` **(** **)** |const| |
  53. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  54. | :ref:`int<class_int>` | :ref:`get_selectable_item<class_OptionButton_method_get_selectable_item>` **(** :ref:`bool<class_bool>` from_last=false **)** |const| |
  55. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  56. | :ref:`int<class_int>` | :ref:`get_selected_id<class_OptionButton_method_get_selected_id>` **(** **)** |const| |
  57. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  58. | :ref:`Variant<class_Variant>` | :ref:`get_selected_metadata<class_OptionButton_method_get_selected_metadata>` **(** **)** |const| |
  59. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  60. | :ref:`bool<class_bool>` | :ref:`has_selectable_items<class_OptionButton_method_has_selectable_items>` **(** **)** |const| |
  61. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  62. | :ref:`bool<class_bool>` | :ref:`is_item_disabled<class_OptionButton_method_is_item_disabled>` **(** :ref:`int<class_int>` idx **)** |const| |
  63. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  64. | :ref:`bool<class_bool>` | :ref:`is_item_separator<class_OptionButton_method_is_item_separator>` **(** :ref:`int<class_int>` idx **)** |const| |
  65. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  66. | void | :ref:`remove_item<class_OptionButton_method_remove_item>` **(** :ref:`int<class_int>` idx **)** |
  67. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  68. | void | :ref:`select<class_OptionButton_method_select>` **(** :ref:`int<class_int>` idx **)** |
  69. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  70. | void | :ref:`set_item_disabled<class_OptionButton_method_set_item_disabled>` **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` disabled **)** |
  71. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  72. | void | :ref:`set_item_icon<class_OptionButton_method_set_item_icon>` **(** :ref:`int<class_int>` idx, :ref:`Texture2D<class_Texture2D>` texture **)** |
  73. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  74. | void | :ref:`set_item_id<class_OptionButton_method_set_item_id>` **(** :ref:`int<class_int>` idx, :ref:`int<class_int>` id **)** |
  75. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  76. | void | :ref:`set_item_metadata<class_OptionButton_method_set_item_metadata>` **(** :ref:`int<class_int>` idx, :ref:`Variant<class_Variant>` metadata **)** |
  77. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  78. | void | :ref:`set_item_text<class_OptionButton_method_set_item_text>` **(** :ref:`int<class_int>` idx, :ref:`String<class_String>` text **)** |
  79. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  80. | void | :ref:`set_item_tooltip<class_OptionButton_method_set_item_tooltip>` **(** :ref:`int<class_int>` idx, :ref:`String<class_String>` tooltip **)** |
  81. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  82. Theme Properties
  83. ----------------
  84. +-----------------------------------+--------------------------------------------------------------------------------+-------------------------------------+
  85. | :ref:`Color<class_Color>` | :ref:`font_color<class_OptionButton_theme_color_font_color>` | ``Color(0.875, 0.875, 0.875, 1)`` |
  86. +-----------------------------------+--------------------------------------------------------------------------------+-------------------------------------+
  87. | :ref:`Color<class_Color>` | :ref:`font_disabled_color<class_OptionButton_theme_color_font_disabled_color>` | ``Color(0.875, 0.875, 0.875, 0.5)`` |
  88. +-----------------------------------+--------------------------------------------------------------------------------+-------------------------------------+
  89. | :ref:`Color<class_Color>` | :ref:`font_focus_color<class_OptionButton_theme_color_font_focus_color>` | ``Color(0.95, 0.95, 0.95, 1)`` |
  90. +-----------------------------------+--------------------------------------------------------------------------------+-------------------------------------+
  91. | :ref:`Color<class_Color>` | :ref:`font_hover_color<class_OptionButton_theme_color_font_hover_color>` | ``Color(0.95, 0.95, 0.95, 1)`` |
  92. +-----------------------------------+--------------------------------------------------------------------------------+-------------------------------------+
  93. | :ref:`Color<class_Color>` | :ref:`font_outline_color<class_OptionButton_theme_color_font_outline_color>` | ``Color(1, 1, 1, 1)`` |
  94. +-----------------------------------+--------------------------------------------------------------------------------+-------------------------------------+
  95. | :ref:`Color<class_Color>` | :ref:`font_pressed_color<class_OptionButton_theme_color_font_pressed_color>` | ``Color(1, 1, 1, 1)`` |
  96. +-----------------------------------+--------------------------------------------------------------------------------+-------------------------------------+
  97. | :ref:`int<class_int>` | :ref:`arrow_margin<class_OptionButton_theme_constant_arrow_margin>` | ``4`` |
  98. +-----------------------------------+--------------------------------------------------------------------------------+-------------------------------------+
  99. | :ref:`int<class_int>` | :ref:`h_separation<class_OptionButton_theme_constant_h_separation>` | ``2`` |
  100. +-----------------------------------+--------------------------------------------------------------------------------+-------------------------------------+
  101. | :ref:`int<class_int>` | :ref:`outline_size<class_OptionButton_theme_constant_outline_size>` | ``0`` |
  102. +-----------------------------------+--------------------------------------------------------------------------------+-------------------------------------+
  103. | :ref:`Font<class_Font>` | :ref:`font<class_OptionButton_theme_font_font>` | |
  104. +-----------------------------------+--------------------------------------------------------------------------------+-------------------------------------+
  105. | :ref:`int<class_int>` | :ref:`font_size<class_OptionButton_theme_font_size_font_size>` | |
  106. +-----------------------------------+--------------------------------------------------------------------------------+-------------------------------------+
  107. | :ref:`Texture2D<class_Texture2D>` | :ref:`arrow<class_OptionButton_theme_icon_arrow>` | |
  108. +-----------------------------------+--------------------------------------------------------------------------------+-------------------------------------+
  109. | :ref:`StyleBox<class_StyleBox>` | :ref:`disabled<class_OptionButton_theme_style_disabled>` | |
  110. +-----------------------------------+--------------------------------------------------------------------------------+-------------------------------------+
  111. | :ref:`StyleBox<class_StyleBox>` | :ref:`disabled_mirrored<class_OptionButton_theme_style_disabled_mirrored>` | |
  112. +-----------------------------------+--------------------------------------------------------------------------------+-------------------------------------+
  113. | :ref:`StyleBox<class_StyleBox>` | :ref:`focus<class_OptionButton_theme_style_focus>` | |
  114. +-----------------------------------+--------------------------------------------------------------------------------+-------------------------------------+
  115. | :ref:`StyleBox<class_StyleBox>` | :ref:`hover<class_OptionButton_theme_style_hover>` | |
  116. +-----------------------------------+--------------------------------------------------------------------------------+-------------------------------------+
  117. | :ref:`StyleBox<class_StyleBox>` | :ref:`hover_mirrored<class_OptionButton_theme_style_hover_mirrored>` | |
  118. +-----------------------------------+--------------------------------------------------------------------------------+-------------------------------------+
  119. | :ref:`StyleBox<class_StyleBox>` | :ref:`normal<class_OptionButton_theme_style_normal>` | |
  120. +-----------------------------------+--------------------------------------------------------------------------------+-------------------------------------+
  121. | :ref:`StyleBox<class_StyleBox>` | :ref:`normal_mirrored<class_OptionButton_theme_style_normal_mirrored>` | |
  122. +-----------------------------------+--------------------------------------------------------------------------------+-------------------------------------+
  123. | :ref:`StyleBox<class_StyleBox>` | :ref:`pressed<class_OptionButton_theme_style_pressed>` | |
  124. +-----------------------------------+--------------------------------------------------------------------------------+-------------------------------------+
  125. | :ref:`StyleBox<class_StyleBox>` | :ref:`pressed_mirrored<class_OptionButton_theme_style_pressed_mirrored>` | |
  126. +-----------------------------------+--------------------------------------------------------------------------------+-------------------------------------+
  127. Signals
  128. -------
  129. .. _class_OptionButton_signal_item_focused:
  130. - **item_focused** **(** :ref:`int<class_int>` index **)**
  131. Emitted when the user navigates to an item using the ``ui_up`` or ``ui_down`` actions. The index of the item selected is passed as argument.
  132. ----
  133. .. _class_OptionButton_signal_item_selected:
  134. - **item_selected** **(** :ref:`int<class_int>` index **)**
  135. Emitted when the current item has been changed by the user. The index of the item selected is passed as argument.
  136. Property Descriptions
  137. ---------------------
  138. .. _class_OptionButton_property_item_count:
  139. - :ref:`int<class_int>` **item_count**
  140. +-----------+-----------------------+
  141. | *Default* | ``0`` |
  142. +-----------+-----------------------+
  143. | *Setter* | set_item_count(value) |
  144. +-----------+-----------------------+
  145. | *Getter* | get_item_count() |
  146. +-----------+-----------------------+
  147. The number of items to select from.
  148. ----
  149. .. _class_OptionButton_property_selected:
  150. - :ref:`int<class_int>` **selected**
  151. +-----------+----------------+
  152. | *Default* | ``-1`` |
  153. +-----------+----------------+
  154. | *Getter* | get_selected() |
  155. +-----------+----------------+
  156. The index of the currently selected item, or ``-1`` if no item is selected.
  157. Method Descriptions
  158. -------------------
  159. .. _class_OptionButton_method_add_icon_item:
  160. - void **add_icon_item** **(** :ref:`Texture2D<class_Texture2D>` texture, :ref:`String<class_String>` label, :ref:`int<class_int>` id=-1 **)**
  161. 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.
  162. ----
  163. .. _class_OptionButton_method_add_item:
  164. - void **add_item** **(** :ref:`String<class_String>` label, :ref:`int<class_int>` id=-1 **)**
  165. 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.
  166. ----
  167. .. _class_OptionButton_method_add_separator:
  168. - void **add_separator** **(** :ref:`String<class_String>` text="" **)**
  169. 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.
  170. ----
  171. .. _class_OptionButton_method_clear:
  172. - void **clear** **(** **)**
  173. Clears all the items in the ``OptionButton``.
  174. ----
  175. .. _class_OptionButton_method_get_item_icon:
  176. - :ref:`Texture2D<class_Texture2D>` **get_item_icon** **(** :ref:`int<class_int>` idx **)** |const|
  177. Returns the icon of the item at index ``idx``.
  178. ----
  179. .. _class_OptionButton_method_get_item_id:
  180. - :ref:`int<class_int>` **get_item_id** **(** :ref:`int<class_int>` idx **)** |const|
  181. Returns the ID of the item at index ``idx``.
  182. ----
  183. .. _class_OptionButton_method_get_item_index:
  184. - :ref:`int<class_int>` **get_item_index** **(** :ref:`int<class_int>` id **)** |const|
  185. Returns the index of the item with the given ``id``.
  186. ----
  187. .. _class_OptionButton_method_get_item_metadata:
  188. - :ref:`Variant<class_Variant>` **get_item_metadata** **(** :ref:`int<class_int>` idx **)** |const|
  189. 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.
  190. ----
  191. .. _class_OptionButton_method_get_item_text:
  192. - :ref:`String<class_String>` **get_item_text** **(** :ref:`int<class_int>` idx **)** |const|
  193. Returns the text of the item at index ``idx``.
  194. ----
  195. .. _class_OptionButton_method_get_item_tooltip:
  196. - :ref:`String<class_String>` **get_item_tooltip** **(** :ref:`int<class_int>` idx **)** |const|
  197. Returns the tooltip of the item at index ``idx``.
  198. ----
  199. .. _class_OptionButton_method_get_popup:
  200. - :ref:`PopupMenu<class_PopupMenu>` **get_popup** **(** **)** |const|
  201. Returns the :ref:`PopupMenu<class_PopupMenu>` contained in this button.
  202. \ **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<class_Window_property_visible>` property.
  203. ----
  204. .. _class_OptionButton_method_get_selectable_item:
  205. - :ref:`int<class_int>` **get_selectable_item** **(** :ref:`bool<class_bool>` from_last=false **)** |const|
  206. ----
  207. .. _class_OptionButton_method_get_selected_id:
  208. - :ref:`int<class_int>` **get_selected_id** **(** **)** |const|
  209. Returns the ID of the selected item, or ``-1`` if no item is selected.
  210. ----
  211. .. _class_OptionButton_method_get_selected_metadata:
  212. - :ref:`Variant<class_Variant>` **get_selected_metadata** **(** **)** |const|
  213. Gets the metadata of the selected item. Metadata for items can be set using :ref:`set_item_metadata<class_OptionButton_method_set_item_metadata>`.
  214. ----
  215. .. _class_OptionButton_method_has_selectable_items:
  216. - :ref:`bool<class_bool>` **has_selectable_items** **(** **)** |const|
  217. ----
  218. .. _class_OptionButton_method_is_item_disabled:
  219. - :ref:`bool<class_bool>` **is_item_disabled** **(** :ref:`int<class_int>` idx **)** |const|
  220. Returns ``true`` if the item at index ``idx`` is disabled.
  221. ----
  222. .. _class_OptionButton_method_is_item_separator:
  223. - :ref:`bool<class_bool>` **is_item_separator** **(** :ref:`int<class_int>` idx **)** |const|
  224. ----
  225. .. _class_OptionButton_method_remove_item:
  226. - void **remove_item** **(** :ref:`int<class_int>` idx **)**
  227. Removes the item at index ``idx``.
  228. ----
  229. .. _class_OptionButton_method_select:
  230. - void **select** **(** :ref:`int<class_int>` idx **)**
  231. Selects an item by index and makes it the current item. This will work even if the item is disabled.
  232. Passing ``-1`` as the index deselects any currently selected item.
  233. ----
  234. .. _class_OptionButton_method_set_item_disabled:
  235. - void **set_item_disabled** **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` disabled **)**
  236. Sets whether the item at index ``idx`` is disabled.
  237. 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.
  238. ----
  239. .. _class_OptionButton_method_set_item_icon:
  240. - void **set_item_icon** **(** :ref:`int<class_int>` idx, :ref:`Texture2D<class_Texture2D>` texture **)**
  241. Sets the icon of the item at index ``idx``.
  242. ----
  243. .. _class_OptionButton_method_set_item_id:
  244. - void **set_item_id** **(** :ref:`int<class_int>` idx, :ref:`int<class_int>` id **)**
  245. Sets the ID of the item at index ``idx``.
  246. ----
  247. .. _class_OptionButton_method_set_item_metadata:
  248. - void **set_item_metadata** **(** :ref:`int<class_int>` idx, :ref:`Variant<class_Variant>` metadata **)**
  249. 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.
  250. ----
  251. .. _class_OptionButton_method_set_item_text:
  252. - void **set_item_text** **(** :ref:`int<class_int>` idx, :ref:`String<class_String>` text **)**
  253. Sets the text of the item at index ``idx``.
  254. ----
  255. .. _class_OptionButton_method_set_item_tooltip:
  256. - void **set_item_tooltip** **(** :ref:`int<class_int>` idx, :ref:`String<class_String>` tooltip **)**
  257. Sets the tooltip of the item at index ``idx``.
  258. Theme Property Descriptions
  259. ---------------------------
  260. .. _class_OptionButton_theme_color_font_color:
  261. - :ref:`Color<class_Color>` **font_color**
  262. +-----------+-----------------------------------+
  263. | *Default* | ``Color(0.875, 0.875, 0.875, 1)`` |
  264. +-----------+-----------------------------------+
  265. Default text :ref:`Color<class_Color>` of the ``OptionButton``.
  266. ----
  267. .. _class_OptionButton_theme_color_font_disabled_color:
  268. - :ref:`Color<class_Color>` **font_disabled_color**
  269. +-----------+-------------------------------------+
  270. | *Default* | ``Color(0.875, 0.875, 0.875, 0.5)`` |
  271. +-----------+-------------------------------------+
  272. Text :ref:`Color<class_Color>` used when the ``OptionButton`` is disabled.
  273. ----
  274. .. _class_OptionButton_theme_color_font_focus_color:
  275. - :ref:`Color<class_Color>` **font_focus_color**
  276. +-----------+--------------------------------+
  277. | *Default* | ``Color(0.95, 0.95, 0.95, 1)`` |
  278. +-----------+--------------------------------+
  279. Text :ref:`Color<class_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.
  280. ----
  281. .. _class_OptionButton_theme_color_font_hover_color:
  282. - :ref:`Color<class_Color>` **font_hover_color**
  283. +-----------+--------------------------------+
  284. | *Default* | ``Color(0.95, 0.95, 0.95, 1)`` |
  285. +-----------+--------------------------------+
  286. Text :ref:`Color<class_Color>` used when the ``OptionButton`` is being hovered.
  287. ----
  288. .. _class_OptionButton_theme_color_font_outline_color:
  289. - :ref:`Color<class_Color>` **font_outline_color**
  290. +-----------+-----------------------+
  291. | *Default* | ``Color(1, 1, 1, 1)`` |
  292. +-----------+-----------------------+
  293. The tint of text outline of the ``OptionButton``.
  294. ----
  295. .. _class_OptionButton_theme_color_font_pressed_color:
  296. - :ref:`Color<class_Color>` **font_pressed_color**
  297. +-----------+-----------------------+
  298. | *Default* | ``Color(1, 1, 1, 1)`` |
  299. +-----------+-----------------------+
  300. Text :ref:`Color<class_Color>` used when the ``OptionButton`` is being pressed.
  301. ----
  302. .. _class_OptionButton_theme_constant_arrow_margin:
  303. - :ref:`int<class_int>` **arrow_margin**
  304. +-----------+-------+
  305. | *Default* | ``4`` |
  306. +-----------+-------+
  307. The horizontal space between the arrow icon and the right edge of the button.
  308. ----
  309. .. _class_OptionButton_theme_constant_h_separation:
  310. - :ref:`int<class_int>` **h_separation**
  311. +-----------+-------+
  312. | *Default* | ``2`` |
  313. +-----------+-------+
  314. The horizontal space between ``OptionButton``'s icon and text.
  315. ----
  316. .. _class_OptionButton_theme_constant_outline_size:
  317. - :ref:`int<class_int>` **outline_size**
  318. +-----------+-------+
  319. | *Default* | ``0`` |
  320. +-----------+-------+
  321. The size of the text outline.
  322. ----
  323. .. _class_OptionButton_theme_font_font:
  324. - :ref:`Font<class_Font>` **font**
  325. :ref:`Font<class_Font>` of the ``OptionButton``'s text.
  326. ----
  327. .. _class_OptionButton_theme_font_size_font_size:
  328. - :ref:`int<class_int>` **font_size**
  329. Font size of the ``OptionButton``'s text.
  330. ----
  331. .. _class_OptionButton_theme_icon_arrow:
  332. - :ref:`Texture2D<class_Texture2D>` **arrow**
  333. The arrow icon to be drawn on the right end of the button.
  334. ----
  335. .. _class_OptionButton_theme_style_disabled:
  336. - :ref:`StyleBox<class_StyleBox>` **disabled**
  337. :ref:`StyleBox<class_StyleBox>` used when the ``OptionButton`` is disabled (for left-to-right layouts).
  338. ----
  339. .. _class_OptionButton_theme_style_disabled_mirrored:
  340. - :ref:`StyleBox<class_StyleBox>` **disabled_mirrored**
  341. :ref:`StyleBox<class_StyleBox>` used when the ``OptionButton`` is disabled (for right-to-left layouts).
  342. ----
  343. .. _class_OptionButton_theme_style_focus:
  344. - :ref:`StyleBox<class_StyleBox>` **focus**
  345. :ref:`StyleBox<class_StyleBox>` used when the ``OptionButton`` is focused. The ``focus`` :ref:`StyleBox<class_StyleBox>` is displayed *over* the base :ref:`StyleBox<class_StyleBox>`, so a partially transparent :ref:`StyleBox<class_StyleBox>` should be used to ensure the base :ref:`StyleBox<class_StyleBox>` remains visible. A :ref:`StyleBox<class_StyleBox>` that represents an outline or an underline works well for this purpose. To disable the focus visual effect, assign a :ref:`StyleBoxEmpty<class_StyleBoxEmpty>` resource. Note that disabling the focus visual effect will harm keyboard/controller navigation usability, so this is not recommended for accessibility reasons.
  346. ----
  347. .. _class_OptionButton_theme_style_hover:
  348. - :ref:`StyleBox<class_StyleBox>` **hover**
  349. :ref:`StyleBox<class_StyleBox>` used when the ``OptionButton`` is being hovered (for left-to-right layouts).
  350. ----
  351. .. _class_OptionButton_theme_style_hover_mirrored:
  352. - :ref:`StyleBox<class_StyleBox>` **hover_mirrored**
  353. :ref:`StyleBox<class_StyleBox>` used when the ``OptionButton`` is being hovered (for right-to-left layouts).
  354. ----
  355. .. _class_OptionButton_theme_style_normal:
  356. - :ref:`StyleBox<class_StyleBox>` **normal**
  357. Default :ref:`StyleBox<class_StyleBox>` for the ``OptionButton`` (for left-to-right layouts).
  358. ----
  359. .. _class_OptionButton_theme_style_normal_mirrored:
  360. - :ref:`StyleBox<class_StyleBox>` **normal_mirrored**
  361. Default :ref:`StyleBox<class_StyleBox>` for the ``OptionButton`` (for right-to-left layouts).
  362. ----
  363. .. _class_OptionButton_theme_style_pressed:
  364. - :ref:`StyleBox<class_StyleBox>` **pressed**
  365. :ref:`StyleBox<class_StyleBox>` used when the ``OptionButton`` is being pressed (for left-to-right layouts).
  366. ----
  367. .. _class_OptionButton_theme_style_pressed_mirrored:
  368. - :ref:`StyleBox<class_StyleBox>` **pressed_mirrored**
  369. :ref:`StyleBox<class_StyleBox>` used when the ``OptionButton`` is being pressed (for right-to-left layouts).
  370. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  371. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  372. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  373. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  374. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  375. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`