class_optionbutton.rst 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the OptionButton.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_OptionButton:
  6. OptionButton
  7. ============
  8. **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>`
  9. Button control that provides selectable options when pressed.
  10. Description
  11. -----------
  12. 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.
  13. See also :ref:`BaseButton<class_BaseButton>` which contains common properties and methods associated with this node.
  14. Properties
  15. ----------
  16. +-----------------------------------------------+-------------------------------------------------------+------------------------------+
  17. | :ref:`ActionMode<enum_BaseButton_ActionMode>` | action_mode | ``0`` *(parent override)* |
  18. +-----------------------------------------------+-------------------------------------------------------+------------------------------+
  19. | :ref:`TextAlign<enum_Button_TextAlign>` | align | ``0`` *(parent override)* |
  20. +-----------------------------------------------+-------------------------------------------------------+------------------------------+
  21. | :ref:`int<class_int>` | :ref:`selected<class_OptionButton_property_selected>` | ``-1`` |
  22. +-----------------------------------------------+-------------------------------------------------------+------------------------------+
  23. | :ref:`bool<class_bool>` | toggle_mode | ``true`` *(parent override)* |
  24. +-----------------------------------------------+-------------------------------------------------------+------------------------------+
  25. Methods
  26. -------
  27. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  28. | 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 **)** |
  29. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  30. | void | :ref:`add_item<class_OptionButton_method_add_item>` **(** :ref:`String<class_String>` label, :ref:`int<class_int>` id=-1 **)** |
  31. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  32. | void | :ref:`add_separator<class_OptionButton_method_add_separator>` **(** **)** |
  33. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  34. | void | :ref:`clear<class_OptionButton_method_clear>` **(** **)** |
  35. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  36. | :ref:`int<class_int>` | :ref:`get_item_count<class_OptionButton_method_get_item_count>` **(** **)** |const| |
  37. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  38. | :ref:`Texture2D<class_Texture2D>` | :ref:`get_item_icon<class_OptionButton_method_get_item_icon>` **(** :ref:`int<class_int>` idx **)** |const| |
  39. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  40. | :ref:`int<class_int>` | :ref:`get_item_id<class_OptionButton_method_get_item_id>` **(** :ref:`int<class_int>` idx **)** |const| |
  41. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  42. | :ref:`int<class_int>` | :ref:`get_item_index<class_OptionButton_method_get_item_index>` **(** :ref:`int<class_int>` id **)** |const| |
  43. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  44. | :ref:`Variant<class_Variant>` | :ref:`get_item_metadata<class_OptionButton_method_get_item_metadata>` **(** :ref:`int<class_int>` idx **)** |const| |
  45. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  46. | :ref:`String<class_String>` | :ref:`get_item_text<class_OptionButton_method_get_item_text>` **(** :ref:`int<class_int>` idx **)** |const| |
  47. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  48. | :ref:`PopupMenu<class_PopupMenu>` | :ref:`get_popup<class_OptionButton_method_get_popup>` **(** **)** |const| |
  49. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  50. | :ref:`int<class_int>` | :ref:`get_selected_id<class_OptionButton_method_get_selected_id>` **(** **)** |const| |
  51. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  52. | :ref:`Variant<class_Variant>` | :ref:`get_selected_metadata<class_OptionButton_method_get_selected_metadata>` **(** **)** |const| |
  53. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  54. | :ref:`bool<class_bool>` | :ref:`is_item_disabled<class_OptionButton_method_is_item_disabled>` **(** :ref:`int<class_int>` idx **)** |const| |
  55. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  56. | void | :ref:`remove_item<class_OptionButton_method_remove_item>` **(** :ref:`int<class_int>` idx **)** |
  57. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  58. | void | :ref:`select<class_OptionButton_method_select>` **(** :ref:`int<class_int>` idx **)** |
  59. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  60. | void | :ref:`set_item_disabled<class_OptionButton_method_set_item_disabled>` **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` disabled **)** |
  61. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  62. | void | :ref:`set_item_icon<class_OptionButton_method_set_item_icon>` **(** :ref:`int<class_int>` idx, :ref:`Texture2D<class_Texture2D>` texture **)** |
  63. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  64. | void | :ref:`set_item_id<class_OptionButton_method_set_item_id>` **(** :ref:`int<class_int>` idx, :ref:`int<class_int>` id **)** |
  65. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  66. | void | :ref:`set_item_metadata<class_OptionButton_method_set_item_metadata>` **(** :ref:`int<class_int>` idx, :ref:`Variant<class_Variant>` metadata **)** |
  67. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  68. | void | :ref:`set_item_text<class_OptionButton_method_set_item_text>` **(** :ref:`int<class_int>` idx, :ref:`String<class_String>` text **)** |
  69. +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  70. Theme Properties
  71. ----------------
  72. +-----------------------------------+--------------------------------------------------------------------------------+--------------------------------+
  73. | :ref:`Texture2D<class_Texture2D>` | :ref:`arrow<class_OptionButton_theme_icon_arrow>` | |
  74. +-----------------------------------+--------------------------------------------------------------------------------+--------------------------------+
  75. | :ref:`int<class_int>` | :ref:`arrow_margin<class_OptionButton_theme_constant_arrow_margin>` | ``2`` |
  76. +-----------------------------------+--------------------------------------------------------------------------------+--------------------------------+
  77. | :ref:`StyleBox<class_StyleBox>` | :ref:`disabled<class_OptionButton_theme_style_disabled>` | |
  78. +-----------------------------------+--------------------------------------------------------------------------------+--------------------------------+
  79. | :ref:`StyleBox<class_StyleBox>` | :ref:`disabled_mirrored<class_OptionButton_theme_style_disabled_mirrored>` | |
  80. +-----------------------------------+--------------------------------------------------------------------------------+--------------------------------+
  81. | :ref:`StyleBox<class_StyleBox>` | :ref:`focus<class_OptionButton_theme_style_focus>` | |
  82. +-----------------------------------+--------------------------------------------------------------------------------+--------------------------------+
  83. | :ref:`Font<class_Font>` | :ref:`font<class_OptionButton_theme_font_font>` | |
  84. +-----------------------------------+--------------------------------------------------------------------------------+--------------------------------+
  85. | :ref:`Color<class_Color>` | :ref:`font_color<class_OptionButton_theme_color_font_color>` | ``Color(0.88, 0.88, 0.88, 1)`` |
  86. +-----------------------------------+--------------------------------------------------------------------------------+--------------------------------+
  87. | :ref:`Color<class_Color>` | :ref:`font_disabled_color<class_OptionButton_theme_color_font_disabled_color>` | ``Color(0.9, 0.9, 0.9, 0.2)`` |
  88. +-----------------------------------+--------------------------------------------------------------------------------+--------------------------------+
  89. | :ref:`Color<class_Color>` | :ref:`font_focus_color<class_OptionButton_theme_color_font_focus_color>` | ``Color(0.94, 0.94, 0.94, 1)`` |
  90. +-----------------------------------+--------------------------------------------------------------------------------+--------------------------------+
  91. | :ref:`Color<class_Color>` | :ref:`font_hover_color<class_OptionButton_theme_color_font_hover_color>` | ``Color(0.94, 0.94, 0.94, 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:`font_size<class_OptionButton_theme_font_size_font_size>` | |
  98. +-----------------------------------+--------------------------------------------------------------------------------+--------------------------------+
  99. | :ref:`StyleBox<class_StyleBox>` | :ref:`hover<class_OptionButton_theme_style_hover>` | |
  100. +-----------------------------------+--------------------------------------------------------------------------------+--------------------------------+
  101. | :ref:`StyleBox<class_StyleBox>` | :ref:`hover_mirrored<class_OptionButton_theme_style_hover_mirrored>` | |
  102. +-----------------------------------+--------------------------------------------------------------------------------+--------------------------------+
  103. | :ref:`int<class_int>` | :ref:`hseparation<class_OptionButton_theme_constant_hseparation>` | ``2`` |
  104. +-----------------------------------+--------------------------------------------------------------------------------+--------------------------------+
  105. | :ref:`StyleBox<class_StyleBox>` | :ref:`normal<class_OptionButton_theme_style_normal>` | |
  106. +-----------------------------------+--------------------------------------------------------------------------------+--------------------------------+
  107. | :ref:`StyleBox<class_StyleBox>` | :ref:`normal_mirrored<class_OptionButton_theme_style_normal_mirrored>` | |
  108. +-----------------------------------+--------------------------------------------------------------------------------+--------------------------------+
  109. | :ref:`int<class_int>` | :ref:`outline_size<class_OptionButton_theme_constant_outline_size>` | ``0`` |
  110. +-----------------------------------+--------------------------------------------------------------------------------+--------------------------------+
  111. | :ref:`StyleBox<class_StyleBox>` | :ref:`pressed<class_OptionButton_theme_style_pressed>` | |
  112. +-----------------------------------+--------------------------------------------------------------------------------+--------------------------------+
  113. | :ref:`StyleBox<class_StyleBox>` | :ref:`pressed_mirrored<class_OptionButton_theme_style_pressed_mirrored>` | |
  114. +-----------------------------------+--------------------------------------------------------------------------------+--------------------------------+
  115. Signals
  116. -------
  117. .. _class_OptionButton_signal_item_focused:
  118. - **item_focused** **(** :ref:`int<class_int>` index **)**
  119. 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.
  120. ----
  121. .. _class_OptionButton_signal_item_selected:
  122. - **item_selected** **(** :ref:`int<class_int>` index **)**
  123. Emitted when the current item has been changed by the user. The index of the item selected is passed as argument.
  124. Property Descriptions
  125. ---------------------
  126. .. _class_OptionButton_property_selected:
  127. - :ref:`int<class_int>` **selected**
  128. +-----------+----------------+
  129. | *Default* | ``-1`` |
  130. +-----------+----------------+
  131. | *Getter* | get_selected() |
  132. +-----------+----------------+
  133. The index of the currently selected item, or ``-1`` if no item is selected.
  134. Method Descriptions
  135. -------------------
  136. .. _class_OptionButton_method_add_icon_item:
  137. - void **add_icon_item** **(** :ref:`Texture2D<class_Texture2D>` texture, :ref:`String<class_String>` label, :ref:`int<class_int>` id=-1 **)**
  138. 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.
  139. ----
  140. .. _class_OptionButton_method_add_item:
  141. - void **add_item** **(** :ref:`String<class_String>` label, :ref:`int<class_int>` id=-1 **)**
  142. 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.
  143. ----
  144. .. _class_OptionButton_method_add_separator:
  145. - void **add_separator** **(** **)**
  146. 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.
  147. ----
  148. .. _class_OptionButton_method_clear:
  149. - void **clear** **(** **)**
  150. Clears all the items in the ``OptionButton``.
  151. ----
  152. .. _class_OptionButton_method_get_item_count:
  153. - :ref:`int<class_int>` **get_item_count** **(** **)** |const|
  154. Returns the amount of items in the OptionButton, including separators.
  155. ----
  156. .. _class_OptionButton_method_get_item_icon:
  157. - :ref:`Texture2D<class_Texture2D>` **get_item_icon** **(** :ref:`int<class_int>` idx **)** |const|
  158. Returns the icon of the item at index ``idx``.
  159. ----
  160. .. _class_OptionButton_method_get_item_id:
  161. - :ref:`int<class_int>` **get_item_id** **(** :ref:`int<class_int>` idx **)** |const|
  162. Returns the ID of the item at index ``idx``.
  163. ----
  164. .. _class_OptionButton_method_get_item_index:
  165. - :ref:`int<class_int>` **get_item_index** **(** :ref:`int<class_int>` id **)** |const|
  166. Returns the index of the item with the given ``id``.
  167. ----
  168. .. _class_OptionButton_method_get_item_metadata:
  169. - :ref:`Variant<class_Variant>` **get_item_metadata** **(** :ref:`int<class_int>` idx **)** |const|
  170. 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.
  171. ----
  172. .. _class_OptionButton_method_get_item_text:
  173. - :ref:`String<class_String>` **get_item_text** **(** :ref:`int<class_int>` idx **)** |const|
  174. Returns the text of the item at index ``idx``.
  175. ----
  176. .. _class_OptionButton_method_get_popup:
  177. - :ref:`PopupMenu<class_PopupMenu>` **get_popup** **(** **)** |const|
  178. Returns the :ref:`PopupMenu<class_PopupMenu>` contained in this button.
  179. **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.
  180. ----
  181. .. _class_OptionButton_method_get_selected_id:
  182. - :ref:`int<class_int>` **get_selected_id** **(** **)** |const|
  183. Returns the ID of the selected item, or ``0`` if no item is selected.
  184. ----
  185. .. _class_OptionButton_method_get_selected_metadata:
  186. - :ref:`Variant<class_Variant>` **get_selected_metadata** **(** **)** |const|
  187. Gets the metadata of the selected item. Metadata for items can be set using :ref:`set_item_metadata<class_OptionButton_method_set_item_metadata>`.
  188. ----
  189. .. _class_OptionButton_method_is_item_disabled:
  190. - :ref:`bool<class_bool>` **is_item_disabled** **(** :ref:`int<class_int>` idx **)** |const|
  191. Returns ``true`` if the item at index ``idx`` is disabled.
  192. ----
  193. .. _class_OptionButton_method_remove_item:
  194. - void **remove_item** **(** :ref:`int<class_int>` idx **)**
  195. Removes the item at index ``idx``.
  196. ----
  197. .. _class_OptionButton_method_select:
  198. - void **select** **(** :ref:`int<class_int>` idx **)**
  199. Selects an item by index and makes it the current item. This will work even if the item is disabled.
  200. ----
  201. .. _class_OptionButton_method_set_item_disabled:
  202. - void **set_item_disabled** **(** :ref:`int<class_int>` idx, :ref:`bool<class_bool>` disabled **)**
  203. Sets whether the item at index ``idx`` is disabled.
  204. 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.
  205. ----
  206. .. _class_OptionButton_method_set_item_icon:
  207. - void **set_item_icon** **(** :ref:`int<class_int>` idx, :ref:`Texture2D<class_Texture2D>` texture **)**
  208. Sets the icon of the item at index ``idx``.
  209. ----
  210. .. _class_OptionButton_method_set_item_id:
  211. - void **set_item_id** **(** :ref:`int<class_int>` idx, :ref:`int<class_int>` id **)**
  212. Sets the ID of the item at index ``idx``.
  213. ----
  214. .. _class_OptionButton_method_set_item_metadata:
  215. - void **set_item_metadata** **(** :ref:`int<class_int>` idx, :ref:`Variant<class_Variant>` metadata **)**
  216. 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.
  217. ----
  218. .. _class_OptionButton_method_set_item_text:
  219. - void **set_item_text** **(** :ref:`int<class_int>` idx, :ref:`String<class_String>` text **)**
  220. Sets the text of the item at index ``idx``.
  221. Theme Property Descriptions
  222. ---------------------------
  223. .. _class_OptionButton_theme_icon_arrow:
  224. - :ref:`Texture2D<class_Texture2D>` **arrow**
  225. The arrow icon to be drawn on the right end of the button.
  226. ----
  227. .. _class_OptionButton_theme_constant_arrow_margin:
  228. - :ref:`int<class_int>` **arrow_margin**
  229. +-----------+-------+
  230. | *Default* | ``2`` |
  231. +-----------+-------+
  232. The horizontal space between the arrow icon and the right edge of the button.
  233. ----
  234. .. _class_OptionButton_theme_style_disabled:
  235. - :ref:`StyleBox<class_StyleBox>` **disabled**
  236. :ref:`StyleBox<class_StyleBox>` used when the ``OptionButton`` is disabled (for left-to-right layouts).
  237. ----
  238. .. _class_OptionButton_theme_style_disabled_mirrored:
  239. - :ref:`StyleBox<class_StyleBox>` **disabled_mirrored**
  240. :ref:`StyleBox<class_StyleBox>` used when the ``OptionButton`` is disabled (for right-to-left layouts).
  241. ----
  242. .. _class_OptionButton_theme_style_focus:
  243. - :ref:`StyleBox<class_StyleBox>` **focus**
  244. :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.
  245. ----
  246. .. _class_OptionButton_theme_font_font:
  247. - :ref:`Font<class_Font>` **font**
  248. :ref:`Font<class_Font>` of the ``OptionButton``'s text.
  249. ----
  250. .. _class_OptionButton_theme_color_font_color:
  251. - :ref:`Color<class_Color>` **font_color**
  252. +-----------+--------------------------------+
  253. | *Default* | ``Color(0.88, 0.88, 0.88, 1)`` |
  254. +-----------+--------------------------------+
  255. Default text :ref:`Color<class_Color>` of the ``OptionButton``.
  256. ----
  257. .. _class_OptionButton_theme_color_font_disabled_color:
  258. - :ref:`Color<class_Color>` **font_disabled_color**
  259. +-----------+-------------------------------+
  260. | *Default* | ``Color(0.9, 0.9, 0.9, 0.2)`` |
  261. +-----------+-------------------------------+
  262. Text :ref:`Color<class_Color>` used when the ``OptionButton`` is disabled.
  263. ----
  264. .. _class_OptionButton_theme_color_font_focus_color:
  265. - :ref:`Color<class_Color>` **font_focus_color**
  266. +-----------+--------------------------------+
  267. | *Default* | ``Color(0.94, 0.94, 0.94, 1)`` |
  268. +-----------+--------------------------------+
  269. 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.
  270. ----
  271. .. _class_OptionButton_theme_color_font_hover_color:
  272. - :ref:`Color<class_Color>` **font_hover_color**
  273. +-----------+--------------------------------+
  274. | *Default* | ``Color(0.94, 0.94, 0.94, 1)`` |
  275. +-----------+--------------------------------+
  276. Text :ref:`Color<class_Color>` used when the ``OptionButton`` is being hovered.
  277. ----
  278. .. _class_OptionButton_theme_color_font_outline_color:
  279. - :ref:`Color<class_Color>` **font_outline_color**
  280. +-----------+-----------------------+
  281. | *Default* | ``Color(1, 1, 1, 1)`` |
  282. +-----------+-----------------------+
  283. The tint of text outline of the ``OptionButton``.
  284. ----
  285. .. _class_OptionButton_theme_color_font_pressed_color:
  286. - :ref:`Color<class_Color>` **font_pressed_color**
  287. +-----------+-----------------------+
  288. | *Default* | ``Color(1, 1, 1, 1)`` |
  289. +-----------+-----------------------+
  290. Text :ref:`Color<class_Color>` used when the ``OptionButton`` is being pressed.
  291. ----
  292. .. _class_OptionButton_theme_font_size_font_size:
  293. - :ref:`int<class_int>` **font_size**
  294. Font size of the ``OptionButton``'s text.
  295. ----
  296. .. _class_OptionButton_theme_style_hover:
  297. - :ref:`StyleBox<class_StyleBox>` **hover**
  298. :ref:`StyleBox<class_StyleBox>` used when the ``OptionButton`` is being hovered (for left-to-right layouts).
  299. ----
  300. .. _class_OptionButton_theme_style_hover_mirrored:
  301. - :ref:`StyleBox<class_StyleBox>` **hover_mirrored**
  302. :ref:`StyleBox<class_StyleBox>` used when the ``OptionButton`` is being hovered (for right-to-left layouts).
  303. ----
  304. .. _class_OptionButton_theme_constant_hseparation:
  305. - :ref:`int<class_int>` **hseparation**
  306. +-----------+-------+
  307. | *Default* | ``2`` |
  308. +-----------+-------+
  309. The horizontal space between ``OptionButton``'s icon and text.
  310. ----
  311. .. _class_OptionButton_theme_style_normal:
  312. - :ref:`StyleBox<class_StyleBox>` **normal**
  313. Default :ref:`StyleBox<class_StyleBox>` for the ``OptionButton`` (for left-to-right layouts).
  314. ----
  315. .. _class_OptionButton_theme_style_normal_mirrored:
  316. - :ref:`StyleBox<class_StyleBox>` **normal_mirrored**
  317. Default :ref:`StyleBox<class_StyleBox>` for the ``OptionButton`` (for right-to-left layouts).
  318. ----
  319. .. _class_OptionButton_theme_constant_outline_size:
  320. - :ref:`int<class_int>` **outline_size**
  321. +-----------+-------+
  322. | *Default* | ``0`` |
  323. +-----------+-------+
  324. The size of the text outline.
  325. ----
  326. .. _class_OptionButton_theme_style_pressed:
  327. - :ref:`StyleBox<class_StyleBox>` **pressed**
  328. :ref:`StyleBox<class_StyleBox>` used when the ``OptionButton`` is being pressed (for left-to-right layouts).
  329. ----
  330. .. _class_OptionButton_theme_style_pressed_mirrored:
  331. - :ref:`StyleBox<class_StyleBox>` **pressed_mirrored**
  332. :ref:`StyleBox<class_StyleBox>` used when the ``OptionButton`` is being pressed (for right-to-left layouts).
  333. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  334. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  335. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  336. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  337. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  338. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`