class_optionbutton.rst 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653
  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/3.6/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/3.6/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. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. 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.
  15. See also :ref:`BaseButton<class_BaseButton>` which contains common properties and methods associated with this node.
  16. \ **Note:** The ID values used for items are limited to 32 bits, not full 64 bits of :ref:`int<class_int>`. This has a range of ``-2^32`` to ``2^32 - 1``, i.e. ``-2147483648`` to ``2147483647``.
  17. .. rst-class:: classref-reftable-group
  18. Properties
  19. ----------
  20. .. table::
  21. :widths: auto
  22. +-----------------------------------------------+-------------------------------------------------------+-------------------------------------------------------------------------------+
  23. | :ref:`ActionMode<enum_BaseButton_ActionMode>` | action_mode | ``0`` (overrides :ref:`BaseButton<class_BaseButton_property_action_mode>`) |
  24. +-----------------------------------------------+-------------------------------------------------------+-------------------------------------------------------------------------------+
  25. | :ref:`TextAlign<enum_Button_TextAlign>` | align | ``0`` (overrides :ref:`Button<class_Button_property_align>`) |
  26. +-----------------------------------------------+-------------------------------------------------------+-------------------------------------------------------------------------------+
  27. | :ref:`int<class_int>` | :ref:`selected<class_OptionButton_property_selected>` | ``-1`` |
  28. +-----------------------------------------------+-------------------------------------------------------+-------------------------------------------------------------------------------+
  29. | :ref:`bool<class_bool>` | toggle_mode | ``true`` (overrides :ref:`BaseButton<class_BaseButton_property_toggle_mode>`) |
  30. +-----------------------------------------------+-------------------------------------------------------+-------------------------------------------------------------------------------+
  31. .. rst-class:: classref-reftable-group
  32. Methods
  33. -------
  34. .. table::
  35. :widths: auto
  36. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  37. | void | :ref:`add_icon_item<class_OptionButton_method_add_icon_item>` **(** :ref:`Texture<class_Texture>` texture, :ref:`String<class_String>` label, :ref:`int<class_int>` id=-1 **)** |
  38. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  39. | void | :ref:`add_item<class_OptionButton_method_add_item>` **(** :ref:`String<class_String>` label, :ref:`int<class_int>` id=-1 **)** |
  40. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  41. | void | :ref:`add_separator<class_OptionButton_method_add_separator>` **(** **)** |
  42. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  43. | void | :ref:`clear<class_OptionButton_method_clear>` **(** **)** |
  44. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  45. | :ref:`int<class_int>` | :ref:`get_item_count<class_OptionButton_method_get_item_count>` **(** **)** |const| |
  46. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  47. | :ref:`Texture<class_Texture>` | :ref:`get_item_icon<class_OptionButton_method_get_item_icon>` **(** :ref:`int<class_int>` idx **)** |const| |
  48. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  49. | :ref:`int<class_int>` | :ref:`get_item_id<class_OptionButton_method_get_item_id>` **(** :ref:`int<class_int>` idx **)** |const| |
  50. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  51. | :ref:`int<class_int>` | :ref:`get_item_index<class_OptionButton_method_get_item_index>` **(** :ref:`int<class_int>` id **)** |const| |
  52. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  53. | :ref:`Variant<class_Variant>` | :ref:`get_item_metadata<class_OptionButton_method_get_item_metadata>` **(** :ref:`int<class_int>` idx **)** |const| |
  54. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  55. | :ref:`String<class_String>` | :ref:`get_item_text<class_OptionButton_method_get_item_text>` **(** :ref:`int<class_int>` idx **)** |const| |
  56. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  57. | :ref:`String<class_String>` | :ref:`get_item_tooltip<class_OptionButton_method_get_item_tooltip>` **(** :ref:`int<class_int>` idx **)** |const| |
  58. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  59. | :ref:`PopupMenu<class_PopupMenu>` | :ref:`get_popup<class_OptionButton_method_get_popup>` **(** **)** |const| |
  60. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  61. | :ref:`int<class_int>` | :ref:`get_selected_id<class_OptionButton_method_get_selected_id>` **(** **)** |const| |
  62. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  63. | :ref:`Variant<class_Variant>` | :ref:`get_selected_metadata<class_OptionButton_method_get_selected_metadata>` **(** **)** |const| |
  64. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  65. | :ref:`bool<class_bool>` | :ref:`is_item_disabled<class_OptionButton_method_is_item_disabled>` **(** :ref:`int<class_int>` idx **)** |const| |
  66. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  67. | void | :ref:`remove_item<class_OptionButton_method_remove_item>` **(** :ref:`int<class_int>` idx **)** |
  68. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  69. | void | :ref:`select<class_OptionButton_method_select>` **(** :ref:`int<class_int>` idx **)** |
  70. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  71. | void | :ref:`set_item_disabled<class_OptionButton_method_set_item_disabled>` **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` disabled **)** |
  72. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  73. | void | :ref:`set_item_icon<class_OptionButton_method_set_item_icon>` **(** :ref:`int<class_int>` idx, :ref:`Texture<class_Texture>` texture **)** |
  74. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  75. | void | :ref:`set_item_id<class_OptionButton_method_set_item_id>` **(** :ref:`int<class_int>` idx, :ref:`int<class_int>` id **)** |
  76. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  77. | void | :ref:`set_item_metadata<class_OptionButton_method_set_item_metadata>` **(** :ref:`int<class_int>` idx, :ref:`Variant<class_Variant>` metadata **)** |
  78. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  79. | void | :ref:`set_item_text<class_OptionButton_method_set_item_text>` **(** :ref:`int<class_int>` idx, :ref:`String<class_String>` text **)** |
  80. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  81. | void | :ref:`set_item_tooltip<class_OptionButton_method_set_item_tooltip>` **(** :ref:`int<class_int>` idx, :ref:`String<class_String>` tooltip **)** |
  82. +-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  83. .. rst-class:: classref-reftable-group
  84. Theme Properties
  85. ----------------
  86. .. table::
  87. :widths: auto
  88. +---------------------------------+--------------------------------------------------------------------------------+----------------------------------+
  89. | :ref:`Color<class_Color>` | :ref:`font_color<class_OptionButton_theme_color_font_color>` | ``Color( 0.88, 0.88, 0.88, 1 )`` |
  90. +---------------------------------+--------------------------------------------------------------------------------+----------------------------------+
  91. | :ref:`Color<class_Color>` | :ref:`font_color_disabled<class_OptionButton_theme_color_font_color_disabled>` | ``Color( 0.9, 0.9, 0.9, 0.2 )`` |
  92. +---------------------------------+--------------------------------------------------------------------------------+----------------------------------+
  93. | :ref:`Color<class_Color>` | :ref:`font_color_focus<class_OptionButton_theme_color_font_color_focus>` | ``Color( 0.94, 0.94, 0.94, 1 )`` |
  94. +---------------------------------+--------------------------------------------------------------------------------+----------------------------------+
  95. | :ref:`Color<class_Color>` | :ref:`font_color_hover<class_OptionButton_theme_color_font_color_hover>` | ``Color( 0.94, 0.94, 0.94, 1 )`` |
  96. +---------------------------------+--------------------------------------------------------------------------------+----------------------------------+
  97. | :ref:`Color<class_Color>` | :ref:`font_color_pressed<class_OptionButton_theme_color_font_color_pressed>` | ``Color( 1, 1, 1, 1 )`` |
  98. +---------------------------------+--------------------------------------------------------------------------------+----------------------------------+
  99. | :ref:`int<class_int>` | :ref:`arrow_margin<class_OptionButton_theme_constant_arrow_margin>` | ``2`` |
  100. +---------------------------------+--------------------------------------------------------------------------------+----------------------------------+
  101. | :ref:`int<class_int>` | :ref:`hseparation<class_OptionButton_theme_constant_hseparation>` | ``2`` |
  102. +---------------------------------+--------------------------------------------------------------------------------+----------------------------------+
  103. | :ref:`Font<class_Font>` | :ref:`font<class_OptionButton_theme_font_font>` | |
  104. +---------------------------------+--------------------------------------------------------------------------------+----------------------------------+
  105. | :ref:`Texture<class_Texture>` | :ref:`arrow<class_OptionButton_theme_icon_arrow>` | |
  106. +---------------------------------+--------------------------------------------------------------------------------+----------------------------------+
  107. | :ref:`StyleBox<class_StyleBox>` | :ref:`disabled<class_OptionButton_theme_style_disabled>` | |
  108. +---------------------------------+--------------------------------------------------------------------------------+----------------------------------+
  109. | :ref:`StyleBox<class_StyleBox>` | :ref:`focus<class_OptionButton_theme_style_focus>` | |
  110. +---------------------------------+--------------------------------------------------------------------------------+----------------------------------+
  111. | :ref:`StyleBox<class_StyleBox>` | :ref:`hover<class_OptionButton_theme_style_hover>` | |
  112. +---------------------------------+--------------------------------------------------------------------------------+----------------------------------+
  113. | :ref:`StyleBox<class_StyleBox>` | :ref:`normal<class_OptionButton_theme_style_normal>` | |
  114. +---------------------------------+--------------------------------------------------------------------------------+----------------------------------+
  115. | :ref:`StyleBox<class_StyleBox>` | :ref:`pressed<class_OptionButton_theme_style_pressed>` | |
  116. +---------------------------------+--------------------------------------------------------------------------------+----------------------------------+
  117. .. rst-class:: classref-section-separator
  118. ----
  119. .. rst-class:: classref-descriptions-group
  120. Signals
  121. -------
  122. .. _class_OptionButton_signal_item_focused:
  123. .. rst-class:: classref-signal
  124. **item_focused** **(** :ref:`int<class_int>` index **)**
  125. 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.
  126. .. rst-class:: classref-item-separator
  127. ----
  128. .. _class_OptionButton_signal_item_selected:
  129. .. rst-class:: classref-signal
  130. **item_selected** **(** :ref:`int<class_int>` index **)**
  131. Emitted when the current item has been changed by the user. The index of the item selected is passed as argument.
  132. .. rst-class:: classref-section-separator
  133. ----
  134. .. rst-class:: classref-descriptions-group
  135. Property Descriptions
  136. ---------------------
  137. .. _class_OptionButton_property_selected:
  138. .. rst-class:: classref-property
  139. :ref:`int<class_int>` **selected** = ``-1``
  140. .. rst-class:: classref-property-setget
  141. - :ref:`int<class_int>` **get_selected** **(** **)**
  142. The index of the currently selected item, or ``-1`` if no item is selected.
  143. .. rst-class:: classref-section-separator
  144. ----
  145. .. rst-class:: classref-descriptions-group
  146. Method Descriptions
  147. -------------------
  148. .. _class_OptionButton_method_add_icon_item:
  149. .. rst-class:: classref-method
  150. void **add_icon_item** **(** :ref:`Texture<class_Texture>` texture, :ref:`String<class_String>` label, :ref:`int<class_int>` id=-1 **)**
  151. 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.
  152. .. rst-class:: classref-item-separator
  153. ----
  154. .. _class_OptionButton_method_add_item:
  155. .. rst-class:: classref-method
  156. void **add_item** **(** :ref:`String<class_String>` label, :ref:`int<class_int>` id=-1 **)**
  157. 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.
  158. .. rst-class:: classref-item-separator
  159. ----
  160. .. _class_OptionButton_method_add_separator:
  161. .. rst-class:: classref-method
  162. void **add_separator** **(** **)**
  163. 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.
  164. .. rst-class:: classref-item-separator
  165. ----
  166. .. _class_OptionButton_method_clear:
  167. .. rst-class:: classref-method
  168. void **clear** **(** **)**
  169. Clears all the items in the **OptionButton**.
  170. .. rst-class:: classref-item-separator
  171. ----
  172. .. _class_OptionButton_method_get_item_count:
  173. .. rst-class:: classref-method
  174. :ref:`int<class_int>` **get_item_count** **(** **)** |const|
  175. Returns the amount of items in the OptionButton, including separators.
  176. .. rst-class:: classref-item-separator
  177. ----
  178. .. _class_OptionButton_method_get_item_icon:
  179. .. rst-class:: classref-method
  180. :ref:`Texture<class_Texture>` **get_item_icon** **(** :ref:`int<class_int>` idx **)** |const|
  181. Returns the icon of the item at index ``idx``.
  182. .. rst-class:: classref-item-separator
  183. ----
  184. .. _class_OptionButton_method_get_item_id:
  185. .. rst-class:: classref-method
  186. :ref:`int<class_int>` **get_item_id** **(** :ref:`int<class_int>` idx **)** |const|
  187. Returns the ID of the item at index ``idx``.
  188. .. rst-class:: classref-item-separator
  189. ----
  190. .. _class_OptionButton_method_get_item_index:
  191. .. rst-class:: classref-method
  192. :ref:`int<class_int>` **get_item_index** **(** :ref:`int<class_int>` id **)** |const|
  193. Returns the index of the item with the given ``id``.
  194. .. rst-class:: classref-item-separator
  195. ----
  196. .. _class_OptionButton_method_get_item_metadata:
  197. .. rst-class:: classref-method
  198. :ref:`Variant<class_Variant>` **get_item_metadata** **(** :ref:`int<class_int>` idx **)** |const|
  199. 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.
  200. .. rst-class:: classref-item-separator
  201. ----
  202. .. _class_OptionButton_method_get_item_text:
  203. .. rst-class:: classref-method
  204. :ref:`String<class_String>` **get_item_text** **(** :ref:`int<class_int>` idx **)** |const|
  205. Returns the text of the item at index ``idx``.
  206. .. rst-class:: classref-item-separator
  207. ----
  208. .. _class_OptionButton_method_get_item_tooltip:
  209. .. rst-class:: classref-method
  210. :ref:`String<class_String>` **get_item_tooltip** **(** :ref:`int<class_int>` idx **)** |const|
  211. Returns the tooltip of the item at index ``idx``.
  212. .. rst-class:: classref-item-separator
  213. ----
  214. .. _class_OptionButton_method_get_popup:
  215. .. rst-class:: classref-method
  216. :ref:`PopupMenu<class_PopupMenu>` **get_popup** **(** **)** |const|
  217. Returns the :ref:`PopupMenu<class_PopupMenu>` contained in this button.
  218. \ **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:`CanvasItem.visible<class_CanvasItem_property_visible>` property.
  219. .. rst-class:: classref-item-separator
  220. ----
  221. .. _class_OptionButton_method_get_selected_id:
  222. .. rst-class:: classref-method
  223. :ref:`int<class_int>` **get_selected_id** **(** **)** |const|
  224. Returns the ID of the selected item, or ``-1`` if no item is selected.
  225. .. rst-class:: classref-item-separator
  226. ----
  227. .. _class_OptionButton_method_get_selected_metadata:
  228. .. rst-class:: classref-method
  229. :ref:`Variant<class_Variant>` **get_selected_metadata** **(** **)** |const|
  230. Gets the metadata of the selected item. Metadata for items can be set using :ref:`set_item_metadata<class_OptionButton_method_set_item_metadata>`.
  231. .. rst-class:: classref-item-separator
  232. ----
  233. .. _class_OptionButton_method_is_item_disabled:
  234. .. rst-class:: classref-method
  235. :ref:`bool<class_bool>` **is_item_disabled** **(** :ref:`int<class_int>` idx **)** |const|
  236. Returns ``true`` if the item at index ``idx`` is disabled.
  237. .. rst-class:: classref-item-separator
  238. ----
  239. .. _class_OptionButton_method_remove_item:
  240. .. rst-class:: classref-method
  241. void **remove_item** **(** :ref:`int<class_int>` idx **)**
  242. Removes the item at index ``idx``.
  243. .. rst-class:: classref-item-separator
  244. ----
  245. .. _class_OptionButton_method_select:
  246. .. rst-class:: classref-method
  247. void **select** **(** :ref:`int<class_int>` idx **)**
  248. Selects an item by index and makes it the current item. This will work even if the item is disabled.
  249. Passing ``-1`` as the index deselects any currently selected item.
  250. .. rst-class:: classref-item-separator
  251. ----
  252. .. _class_OptionButton_method_set_item_disabled:
  253. .. rst-class:: classref-method
  254. void **set_item_disabled** **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` disabled **)**
  255. Sets whether the item at index ``idx`` is disabled.
  256. 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.
  257. .. rst-class:: classref-item-separator
  258. ----
  259. .. _class_OptionButton_method_set_item_icon:
  260. .. rst-class:: classref-method
  261. void **set_item_icon** **(** :ref:`int<class_int>` idx, :ref:`Texture<class_Texture>` texture **)**
  262. Sets the icon of the item at index ``idx``.
  263. .. rst-class:: classref-item-separator
  264. ----
  265. .. _class_OptionButton_method_set_item_id:
  266. .. rst-class:: classref-method
  267. void **set_item_id** **(** :ref:`int<class_int>` idx, :ref:`int<class_int>` id **)**
  268. Sets the ID of the item at index ``idx``.
  269. .. rst-class:: classref-item-separator
  270. ----
  271. .. _class_OptionButton_method_set_item_metadata:
  272. .. rst-class:: classref-method
  273. void **set_item_metadata** **(** :ref:`int<class_int>` idx, :ref:`Variant<class_Variant>` metadata **)**
  274. 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.
  275. .. rst-class:: classref-item-separator
  276. ----
  277. .. _class_OptionButton_method_set_item_text:
  278. .. rst-class:: classref-method
  279. void **set_item_text** **(** :ref:`int<class_int>` idx, :ref:`String<class_String>` text **)**
  280. Sets the text of the item at index ``idx``.
  281. .. rst-class:: classref-item-separator
  282. ----
  283. .. _class_OptionButton_method_set_item_tooltip:
  284. .. rst-class:: classref-method
  285. void **set_item_tooltip** **(** :ref:`int<class_int>` idx, :ref:`String<class_String>` tooltip **)**
  286. Sets the tooltip of the item at index ``idx``.
  287. .. rst-class:: classref-section-separator
  288. ----
  289. .. rst-class:: classref-descriptions-group
  290. Theme Property Descriptions
  291. ---------------------------
  292. .. _class_OptionButton_theme_color_font_color:
  293. .. rst-class:: classref-themeproperty
  294. :ref:`Color<class_Color>` **font_color** = ``Color( 0.88, 0.88, 0.88, 1 )``
  295. Default text :ref:`Color<class_Color>` of the **OptionButton**.
  296. .. rst-class:: classref-item-separator
  297. ----
  298. .. _class_OptionButton_theme_color_font_color_disabled:
  299. .. rst-class:: classref-themeproperty
  300. :ref:`Color<class_Color>` **font_color_disabled** = ``Color( 0.9, 0.9, 0.9, 0.2 )``
  301. Text :ref:`Color<class_Color>` used when the **OptionButton** is disabled.
  302. .. rst-class:: classref-item-separator
  303. ----
  304. .. _class_OptionButton_theme_color_font_color_focus:
  305. .. rst-class:: classref-themeproperty
  306. :ref:`Color<class_Color>` **font_color_focus** = ``Color( 0.94, 0.94, 0.94, 1 )``
  307. 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.
  308. .. rst-class:: classref-item-separator
  309. ----
  310. .. _class_OptionButton_theme_color_font_color_hover:
  311. .. rst-class:: classref-themeproperty
  312. :ref:`Color<class_Color>` **font_color_hover** = ``Color( 0.94, 0.94, 0.94, 1 )``
  313. Text :ref:`Color<class_Color>` used when the **OptionButton** is being hovered.
  314. .. rst-class:: classref-item-separator
  315. ----
  316. .. _class_OptionButton_theme_color_font_color_pressed:
  317. .. rst-class:: classref-themeproperty
  318. :ref:`Color<class_Color>` **font_color_pressed** = ``Color( 1, 1, 1, 1 )``
  319. Text :ref:`Color<class_Color>` used when the **OptionButton** is being pressed.
  320. .. rst-class:: classref-item-separator
  321. ----
  322. .. _class_OptionButton_theme_constant_arrow_margin:
  323. .. rst-class:: classref-themeproperty
  324. :ref:`int<class_int>` **arrow_margin** = ``2``
  325. The horizontal space between the arrow icon and the right edge of the button.
  326. .. rst-class:: classref-item-separator
  327. ----
  328. .. _class_OptionButton_theme_constant_hseparation:
  329. .. rst-class:: classref-themeproperty
  330. :ref:`int<class_int>` **hseparation** = ``2``
  331. The horizontal space between **OptionButton**'s icon and text.
  332. .. rst-class:: classref-item-separator
  333. ----
  334. .. _class_OptionButton_theme_font_font:
  335. .. rst-class:: classref-themeproperty
  336. :ref:`Font<class_Font>` **font**
  337. :ref:`Font<class_Font>` of the **OptionButton**'s text.
  338. .. rst-class:: classref-item-separator
  339. ----
  340. .. _class_OptionButton_theme_icon_arrow:
  341. .. rst-class:: classref-themeproperty
  342. :ref:`Texture<class_Texture>` **arrow**
  343. The arrow icon to be drawn on the right end of the button.
  344. .. rst-class:: classref-item-separator
  345. ----
  346. .. _class_OptionButton_theme_style_disabled:
  347. .. rst-class:: classref-themeproperty
  348. :ref:`StyleBox<class_StyleBox>` **disabled**
  349. :ref:`StyleBox<class_StyleBox>` used when the **OptionButton** is disabled.
  350. .. rst-class:: classref-item-separator
  351. ----
  352. .. _class_OptionButton_theme_style_focus:
  353. .. rst-class:: classref-themeproperty
  354. :ref:`StyleBox<class_StyleBox>` **focus**
  355. :ref:`StyleBox<class_StyleBox>` used when the **OptionButton** is focused. It is displayed over the current :ref:`StyleBox<class_StyleBox>`, so using :ref:`StyleBoxEmpty<class_StyleBoxEmpty>` will just disable the focus visual effect.
  356. .. rst-class:: classref-item-separator
  357. ----
  358. .. _class_OptionButton_theme_style_hover:
  359. .. rst-class:: classref-themeproperty
  360. :ref:`StyleBox<class_StyleBox>` **hover**
  361. :ref:`StyleBox<class_StyleBox>` used when the **OptionButton** is being hovered.
  362. .. rst-class:: classref-item-separator
  363. ----
  364. .. _class_OptionButton_theme_style_normal:
  365. .. rst-class:: classref-themeproperty
  366. :ref:`StyleBox<class_StyleBox>` **normal**
  367. Default :ref:`StyleBox<class_StyleBox>` for the **OptionButton**.
  368. .. rst-class:: classref-item-separator
  369. ----
  370. .. _class_OptionButton_theme_style_pressed:
  371. .. rst-class:: classref-themeproperty
  372. :ref:`StyleBox<class_StyleBox>` **pressed**
  373. :ref:`StyleBox<class_StyleBox>` used when the **OptionButton** is being pressed.
  374. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  375. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  376. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  377. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`