class_theme.rst 63 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784
  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 Theme.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_Theme:
  6. Theme
  7. =====
  8. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  9. Theme for controls.
  10. Description
  11. -----------
  12. A theme for skinning controls. Controls can be skinned individually, but for complex applications, it's more practical to just create a global theme that defines everything. This theme can be applied to any :ref:`Control<class_Control>`; the Control and its children will automatically use it.
  13. Theme resources can alternatively be loaded by writing them in a ``.theme`` file, see the documentation for more information.
  14. Tutorials
  15. ---------
  16. - :doc:`GUI skinning <../tutorials/ui/gui_skinning>`
  17. Properties
  18. ----------
  19. +---------------------------+--------------------------------------------------------------------+---------+
  20. | :ref:`float<class_float>` | :ref:`default_base_scale<class_Theme_property_default_base_scale>` | ``0.0`` |
  21. +---------------------------+--------------------------------------------------------------------+---------+
  22. | :ref:`Font<class_Font>` | :ref:`default_font<class_Theme_property_default_font>` | |
  23. +---------------------------+--------------------------------------------------------------------+---------+
  24. | :ref:`int<class_int>` | :ref:`default_font_size<class_Theme_property_default_font_size>` | ``-1`` |
  25. +---------------------------+--------------------------------------------------------------------+---------+
  26. Methods
  27. -------
  28. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  29. | void | :ref:`clear<class_Theme_method_clear>` **(** **)** |
  30. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  31. | void | :ref:`clear_color<class_Theme_method_clear_color>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |
  32. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  33. | void | :ref:`clear_constant<class_Theme_method_clear_constant>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |
  34. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  35. | void | :ref:`clear_font<class_Theme_method_clear_font>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |
  36. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  37. | void | :ref:`clear_font_size<class_Theme_method_clear_font_size>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |
  38. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  39. | void | :ref:`clear_icon<class_Theme_method_clear_icon>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |
  40. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  41. | void | :ref:`clear_stylebox<class_Theme_method_clear_stylebox>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |
  42. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  43. | void | :ref:`clear_theme_item<class_Theme_method_clear_theme_item>` **(** :ref:`DataType<enum_Theme_DataType>` data_type, :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |
  44. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  45. | void | :ref:`clear_type_variation<class_Theme_method_clear_type_variation>` **(** :ref:`StringName<class_StringName>` theme_type **)** |
  46. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  47. | :ref:`Color<class_Color>` | :ref:`get_color<class_Theme_method_get_color>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |const| |
  48. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  49. | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_color_list<class_Theme_method_get_color_list>` **(** :ref:`String<class_String>` theme_type **)** |const| |
  50. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  51. | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_color_type_list<class_Theme_method_get_color_type_list>` **(** **)** |const| |
  52. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  53. | :ref:`int<class_int>` | :ref:`get_constant<class_Theme_method_get_constant>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |const| |
  54. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  55. | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_constant_list<class_Theme_method_get_constant_list>` **(** :ref:`String<class_String>` theme_type **)** |const| |
  56. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  57. | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_constant_type_list<class_Theme_method_get_constant_type_list>` **(** **)** |const| |
  58. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  59. | :ref:`Font<class_Font>` | :ref:`get_font<class_Theme_method_get_font>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |const| |
  60. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  61. | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_font_list<class_Theme_method_get_font_list>` **(** :ref:`String<class_String>` theme_type **)** |const| |
  62. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  63. | :ref:`int<class_int>` | :ref:`get_font_size<class_Theme_method_get_font_size>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |const| |
  64. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  65. | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_font_size_list<class_Theme_method_get_font_size_list>` **(** :ref:`String<class_String>` theme_type **)** |const| |
  66. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  67. | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_font_size_type_list<class_Theme_method_get_font_size_type_list>` **(** **)** |const| |
  68. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  69. | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_font_type_list<class_Theme_method_get_font_type_list>` **(** **)** |const| |
  70. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  71. | :ref:`Texture2D<class_Texture2D>` | :ref:`get_icon<class_Theme_method_get_icon>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |const| |
  72. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  73. | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_icon_list<class_Theme_method_get_icon_list>` **(** :ref:`String<class_String>` theme_type **)** |const| |
  74. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  75. | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_icon_type_list<class_Theme_method_get_icon_type_list>` **(** **)** |const| |
  76. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  77. | :ref:`StyleBox<class_StyleBox>` | :ref:`get_stylebox<class_Theme_method_get_stylebox>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |const| |
  78. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  79. | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_stylebox_list<class_Theme_method_get_stylebox_list>` **(** :ref:`String<class_String>` theme_type **)** |const| |
  80. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  81. | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_stylebox_type_list<class_Theme_method_get_stylebox_type_list>` **(** **)** |const| |
  82. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  83. | :ref:`Variant<class_Variant>` | :ref:`get_theme_item<class_Theme_method_get_theme_item>` **(** :ref:`DataType<enum_Theme_DataType>` data_type, :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |const| |
  84. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  85. | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_theme_item_list<class_Theme_method_get_theme_item_list>` **(** :ref:`DataType<enum_Theme_DataType>` data_type, :ref:`String<class_String>` theme_type **)** |const| |
  86. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  87. | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_theme_item_type_list<class_Theme_method_get_theme_item_type_list>` **(** :ref:`DataType<enum_Theme_DataType>` data_type **)** |const| |
  88. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  89. | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_type_list<class_Theme_method_get_type_list>` **(** **)** |const| |
  90. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  91. | :ref:`StringName<class_StringName>` | :ref:`get_type_variation_base<class_Theme_method_get_type_variation_base>` **(** :ref:`StringName<class_StringName>` theme_type **)** |const| |
  92. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  93. | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_type_variation_list<class_Theme_method_get_type_variation_list>` **(** :ref:`StringName<class_StringName>` base_type **)** |const| |
  94. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  95. | :ref:`bool<class_bool>` | :ref:`has_color<class_Theme_method_has_color>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |const| |
  96. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  97. | :ref:`bool<class_bool>` | :ref:`has_constant<class_Theme_method_has_constant>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |const| |
  98. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  99. | :ref:`bool<class_bool>` | :ref:`has_default_base_scale<class_Theme_method_has_default_base_scale>` **(** **)** |const| |
  100. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  101. | :ref:`bool<class_bool>` | :ref:`has_default_font<class_Theme_method_has_default_font>` **(** **)** |const| |
  102. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  103. | :ref:`bool<class_bool>` | :ref:`has_default_font_size<class_Theme_method_has_default_font_size>` **(** **)** |const| |
  104. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  105. | :ref:`bool<class_bool>` | :ref:`has_font<class_Theme_method_has_font>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |const| |
  106. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  107. | :ref:`bool<class_bool>` | :ref:`has_font_size<class_Theme_method_has_font_size>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |const| |
  108. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  109. | :ref:`bool<class_bool>` | :ref:`has_icon<class_Theme_method_has_icon>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |const| |
  110. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  111. | :ref:`bool<class_bool>` | :ref:`has_stylebox<class_Theme_method_has_stylebox>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |const| |
  112. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  113. | :ref:`bool<class_bool>` | :ref:`has_theme_item<class_Theme_method_has_theme_item>` **(** :ref:`DataType<enum_Theme_DataType>` data_type, :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |const| |
  114. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  115. | :ref:`bool<class_bool>` | :ref:`is_type_variation<class_Theme_method_is_type_variation>` **(** :ref:`StringName<class_StringName>` theme_type, :ref:`StringName<class_StringName>` base_type **)** |const| |
  116. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  117. | void | :ref:`merge_with<class_Theme_method_merge_with>` **(** :ref:`Theme<class_Theme>` other **)** |
  118. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  119. | void | :ref:`rename_color<class_Theme_method_rename_color>` **(** :ref:`StringName<class_StringName>` old_name, :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |
  120. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  121. | void | :ref:`rename_constant<class_Theme_method_rename_constant>` **(** :ref:`StringName<class_StringName>` old_name, :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |
  122. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  123. | void | :ref:`rename_font<class_Theme_method_rename_font>` **(** :ref:`StringName<class_StringName>` old_name, :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |
  124. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  125. | void | :ref:`rename_font_size<class_Theme_method_rename_font_size>` **(** :ref:`StringName<class_StringName>` old_name, :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |
  126. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  127. | void | :ref:`rename_icon<class_Theme_method_rename_icon>` **(** :ref:`StringName<class_StringName>` old_name, :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |
  128. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  129. | void | :ref:`rename_stylebox<class_Theme_method_rename_stylebox>` **(** :ref:`StringName<class_StringName>` old_name, :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |
  130. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  131. | void | :ref:`rename_theme_item<class_Theme_method_rename_theme_item>` **(** :ref:`DataType<enum_Theme_DataType>` data_type, :ref:`StringName<class_StringName>` old_name, :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |
  132. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  133. | void | :ref:`set_color<class_Theme_method_set_color>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type, :ref:`Color<class_Color>` color **)** |
  134. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  135. | void | :ref:`set_constant<class_Theme_method_set_constant>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type, :ref:`int<class_int>` constant **)** |
  136. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  137. | void | :ref:`set_font<class_Theme_method_set_font>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type, :ref:`Font<class_Font>` font **)** |
  138. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  139. | void | :ref:`set_font_size<class_Theme_method_set_font_size>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type, :ref:`int<class_int>` font_size **)** |
  140. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  141. | void | :ref:`set_icon<class_Theme_method_set_icon>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type, :ref:`Texture2D<class_Texture2D>` texture **)** |
  142. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  143. | void | :ref:`set_stylebox<class_Theme_method_set_stylebox>` **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type, :ref:`StyleBox<class_StyleBox>` texture **)** |
  144. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  145. | void | :ref:`set_theme_item<class_Theme_method_set_theme_item>` **(** :ref:`DataType<enum_Theme_DataType>` data_type, :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type, :ref:`Variant<class_Variant>` value **)** |
  146. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  147. | void | :ref:`set_type_variation<class_Theme_method_set_type_variation>` **(** :ref:`StringName<class_StringName>` theme_type, :ref:`StringName<class_StringName>` base_type **)** |
  148. +---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  149. Enumerations
  150. ------------
  151. .. _enum_Theme_DataType:
  152. .. _class_Theme_constant_DATA_TYPE_COLOR:
  153. .. _class_Theme_constant_DATA_TYPE_CONSTANT:
  154. .. _class_Theme_constant_DATA_TYPE_FONT:
  155. .. _class_Theme_constant_DATA_TYPE_FONT_SIZE:
  156. .. _class_Theme_constant_DATA_TYPE_ICON:
  157. .. _class_Theme_constant_DATA_TYPE_STYLEBOX:
  158. .. _class_Theme_constant_DATA_TYPE_MAX:
  159. enum **DataType**:
  160. - **DATA_TYPE_COLOR** = **0** --- Theme's :ref:`Color<class_Color>` item type.
  161. - **DATA_TYPE_CONSTANT** = **1** --- Theme's constant item type.
  162. - **DATA_TYPE_FONT** = **2** --- Theme's :ref:`Font<class_Font>` item type.
  163. - **DATA_TYPE_FONT_SIZE** = **3** --- Theme's font size item type.
  164. - **DATA_TYPE_ICON** = **4** --- Theme's icon :ref:`Texture2D<class_Texture2D>` item type.
  165. - **DATA_TYPE_STYLEBOX** = **5** --- Theme's :ref:`StyleBox<class_StyleBox>` item type.
  166. - **DATA_TYPE_MAX** = **6** --- Maximum value for the DataType enum.
  167. Property Descriptions
  168. ---------------------
  169. .. _class_Theme_property_default_base_scale:
  170. - :ref:`float<class_float>` **default_base_scale**
  171. +-----------+-------------------------------+
  172. | *Default* | ``0.0`` |
  173. +-----------+-------------------------------+
  174. | *Setter* | set_default_base_scale(value) |
  175. +-----------+-------------------------------+
  176. | *Getter* | get_default_base_scale() |
  177. +-----------+-------------------------------+
  178. The default base scale factor of this ``Theme`` resource. Used by some controls to scale their visual properties based on a global scale factor. If this value is set to ``0.0``, the global scale factor is used.
  179. Use :ref:`has_default_base_scale<class_Theme_method_has_default_base_scale>` to check if this value is valid.
  180. ----
  181. .. _class_Theme_property_default_font:
  182. - :ref:`Font<class_Font>` **default_font**
  183. +----------+-------------------------+
  184. | *Setter* | set_default_font(value) |
  185. +----------+-------------------------+
  186. | *Getter* | get_default_font() |
  187. +----------+-------------------------+
  188. The default font of this ``Theme`` resource. Used as a fallback value for font items defined in this theme, but having invalid values. If this value is also invalid, the global default value is used.
  189. Use :ref:`has_default_font<class_Theme_method_has_default_font>` to check if this value is valid.
  190. ----
  191. .. _class_Theme_property_default_font_size:
  192. - :ref:`int<class_int>` **default_font_size**
  193. +-----------+------------------------------+
  194. | *Default* | ``-1`` |
  195. +-----------+------------------------------+
  196. | *Setter* | set_default_font_size(value) |
  197. +-----------+------------------------------+
  198. | *Getter* | get_default_font_size() |
  199. +-----------+------------------------------+
  200. The default font size of this ``Theme`` resource. Used as a fallback value for font size items defined in this theme, but having invalid values. If this value is set to ``-1``, the global default value is used.
  201. Use :ref:`has_default_font_size<class_Theme_method_has_default_font_size>` to check if this value is valid.
  202. Method Descriptions
  203. -------------------
  204. .. _class_Theme_method_clear:
  205. - void **clear** **(** **)**
  206. Clears all values on the theme.
  207. ----
  208. .. _class_Theme_method_clear_color:
  209. - void **clear_color** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)**
  210. Clears the :ref:`Color<class_Color>` at ``name`` if the theme has ``theme_type``.
  211. ----
  212. .. _class_Theme_method_clear_constant:
  213. - void **clear_constant** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)**
  214. Clears the constant at ``name`` if the theme has ``theme_type``.
  215. ----
  216. .. _class_Theme_method_clear_font:
  217. - void **clear_font** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)**
  218. Clears the :ref:`Font<class_Font>` at ``name`` if the theme has ``theme_type``.
  219. ----
  220. .. _class_Theme_method_clear_font_size:
  221. - void **clear_font_size** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)**
  222. Clears the font size ``name`` if the theme has ``theme_type``.
  223. ----
  224. .. _class_Theme_method_clear_icon:
  225. - void **clear_icon** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)**
  226. Clears the icon at ``name`` if the theme has ``theme_type``.
  227. ----
  228. .. _class_Theme_method_clear_stylebox:
  229. - void **clear_stylebox** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)**
  230. Clears :ref:`StyleBox<class_StyleBox>` at ``name`` if the theme has ``theme_type``.
  231. ----
  232. .. _class_Theme_method_clear_theme_item:
  233. - void **clear_theme_item** **(** :ref:`DataType<enum_Theme_DataType>` data_type, :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)**
  234. Clears the theme item of ``data_type`` at ``name`` if the theme has ``theme_type``.
  235. ----
  236. .. _class_Theme_method_clear_type_variation:
  237. - void **clear_type_variation** **(** :ref:`StringName<class_StringName>` theme_type **)**
  238. Unmarks ``theme_type`` as being a variation of any other type.
  239. ----
  240. .. _class_Theme_method_get_color:
  241. - :ref:`Color<class_Color>` **get_color** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |const|
  242. Returns the :ref:`Color<class_Color>` at ``name`` if the theme has ``theme_type``.
  243. ----
  244. .. _class_Theme_method_get_color_list:
  245. - :ref:`PackedStringArray<class_PackedStringArray>` **get_color_list** **(** :ref:`String<class_String>` theme_type **)** |const|
  246. Returns all the :ref:`Color<class_Color>`\ s as a :ref:`PackedStringArray<class_PackedStringArray>` filled with each :ref:`Color<class_Color>`'s name, for use in :ref:`get_color<class_Theme_method_get_color>`, if the theme has ``theme_type``.
  247. ----
  248. .. _class_Theme_method_get_color_type_list:
  249. - :ref:`PackedStringArray<class_PackedStringArray>` **get_color_type_list** **(** **)** |const|
  250. Returns all the :ref:`Color<class_Color>` types as a :ref:`PackedStringArray<class_PackedStringArray>` filled with unique type names, for use in :ref:`get_color<class_Theme_method_get_color>` and/or :ref:`get_color_list<class_Theme_method_get_color_list>`.
  251. ----
  252. .. _class_Theme_method_get_constant:
  253. - :ref:`int<class_int>` **get_constant** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |const|
  254. Returns the constant at ``name`` if the theme has ``theme_type``.
  255. ----
  256. .. _class_Theme_method_get_constant_list:
  257. - :ref:`PackedStringArray<class_PackedStringArray>` **get_constant_list** **(** :ref:`String<class_String>` theme_type **)** |const|
  258. Returns all the constants as a :ref:`PackedStringArray<class_PackedStringArray>` filled with each constant's name, for use in :ref:`get_constant<class_Theme_method_get_constant>`, if the theme has ``theme_type``.
  259. ----
  260. .. _class_Theme_method_get_constant_type_list:
  261. - :ref:`PackedStringArray<class_PackedStringArray>` **get_constant_type_list** **(** **)** |const|
  262. Returns all the constant types as a :ref:`PackedStringArray<class_PackedStringArray>` filled with unique type names, for use in :ref:`get_constant<class_Theme_method_get_constant>` and/or :ref:`get_constant_list<class_Theme_method_get_constant_list>`.
  263. ----
  264. .. _class_Theme_method_get_font:
  265. - :ref:`Font<class_Font>` **get_font** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |const|
  266. Returns the :ref:`Font<class_Font>` at ``name`` if the theme has ``theme_type``.
  267. ----
  268. .. _class_Theme_method_get_font_list:
  269. - :ref:`PackedStringArray<class_PackedStringArray>` **get_font_list** **(** :ref:`String<class_String>` theme_type **)** |const|
  270. Returns all the :ref:`Font<class_Font>`\ s as a :ref:`PackedStringArray<class_PackedStringArray>` filled with each :ref:`Font<class_Font>`'s name, for use in :ref:`get_font<class_Theme_method_get_font>`, if the theme has ``theme_type``.
  271. ----
  272. .. _class_Theme_method_get_font_size:
  273. - :ref:`int<class_int>` **get_font_size** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |const|
  274. Returns the font size at ``name`` if the theme has ``theme_type``.
  275. ----
  276. .. _class_Theme_method_get_font_size_list:
  277. - :ref:`PackedStringArray<class_PackedStringArray>` **get_font_size_list** **(** :ref:`String<class_String>` theme_type **)** |const|
  278. Returns all the font sizes as a :ref:`PackedStringArray<class_PackedStringArray>` filled with each font size name, for use in :ref:`get_font_size<class_Theme_method_get_font_size>`, if the theme has ``theme_type``.
  279. ----
  280. .. _class_Theme_method_get_font_size_type_list:
  281. - :ref:`PackedStringArray<class_PackedStringArray>` **get_font_size_type_list** **(** **)** |const|
  282. Returns all the font size types as a :ref:`PackedStringArray<class_PackedStringArray>` filled with unique type names, for use in :ref:`get_font_size<class_Theme_method_get_font_size>` and/or :ref:`get_font_size_list<class_Theme_method_get_font_size_list>`.
  283. ----
  284. .. _class_Theme_method_get_font_type_list:
  285. - :ref:`PackedStringArray<class_PackedStringArray>` **get_font_type_list** **(** **)** |const|
  286. Returns all the :ref:`Font<class_Font>` types as a :ref:`PackedStringArray<class_PackedStringArray>` filled with unique type names, for use in :ref:`get_font<class_Theme_method_get_font>` and/or :ref:`get_font_list<class_Theme_method_get_font_list>`.
  287. ----
  288. .. _class_Theme_method_get_icon:
  289. - :ref:`Texture2D<class_Texture2D>` **get_icon** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |const|
  290. Returns the icon :ref:`Texture2D<class_Texture2D>` at ``name`` if the theme has ``theme_type``.
  291. ----
  292. .. _class_Theme_method_get_icon_list:
  293. - :ref:`PackedStringArray<class_PackedStringArray>` **get_icon_list** **(** :ref:`String<class_String>` theme_type **)** |const|
  294. Returns all the icons as a :ref:`PackedStringArray<class_PackedStringArray>` filled with each :ref:`Texture2D<class_Texture2D>`'s name, for use in :ref:`get_icon<class_Theme_method_get_icon>`, if the theme has ``theme_type``.
  295. ----
  296. .. _class_Theme_method_get_icon_type_list:
  297. - :ref:`PackedStringArray<class_PackedStringArray>` **get_icon_type_list** **(** **)** |const|
  298. Returns all the icon types as a :ref:`PackedStringArray<class_PackedStringArray>` filled with unique type names, for use in :ref:`get_icon<class_Theme_method_get_icon>` and/or :ref:`get_icon_list<class_Theme_method_get_icon_list>`.
  299. ----
  300. .. _class_Theme_method_get_stylebox:
  301. - :ref:`StyleBox<class_StyleBox>` **get_stylebox** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |const|
  302. Returns the :ref:`StyleBox<class_StyleBox>` at ``name`` if the theme has ``theme_type``.
  303. Valid ``name``\ s may be found using :ref:`get_stylebox_list<class_Theme_method_get_stylebox_list>`. Valid ``theme_type``\ s may be found using :ref:`get_stylebox_type_list<class_Theme_method_get_stylebox_type_list>`.
  304. ----
  305. .. _class_Theme_method_get_stylebox_list:
  306. - :ref:`PackedStringArray<class_PackedStringArray>` **get_stylebox_list** **(** :ref:`String<class_String>` theme_type **)** |const|
  307. Returns all the :ref:`StyleBox<class_StyleBox>`\ s as a :ref:`PackedStringArray<class_PackedStringArray>` filled with each :ref:`StyleBox<class_StyleBox>`'s name, for use in :ref:`get_stylebox<class_Theme_method_get_stylebox>`, if the theme has ``theme_type``.
  308. Valid ``theme_type``\ s may be found using :ref:`get_stylebox_type_list<class_Theme_method_get_stylebox_type_list>`.
  309. ----
  310. .. _class_Theme_method_get_stylebox_type_list:
  311. - :ref:`PackedStringArray<class_PackedStringArray>` **get_stylebox_type_list** **(** **)** |const|
  312. Returns all the :ref:`StyleBox<class_StyleBox>` types as a :ref:`PackedStringArray<class_PackedStringArray>` filled with unique type names, for use in :ref:`get_stylebox<class_Theme_method_get_stylebox>` and/or :ref:`get_stylebox_list<class_Theme_method_get_stylebox_list>`.
  313. ----
  314. .. _class_Theme_method_get_theme_item:
  315. - :ref:`Variant<class_Variant>` **get_theme_item** **(** :ref:`DataType<enum_Theme_DataType>` data_type, :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |const|
  316. Returns the theme item of ``data_type`` at ``name`` if the theme has ``theme_type``.
  317. Valid ``name``\ s may be found using :ref:`get_theme_item_list<class_Theme_method_get_theme_item_list>` or a data type specific method. Valid ``theme_type``\ s may be found using :ref:`get_theme_item_type_list<class_Theme_method_get_theme_item_type_list>` or a data type specific method.
  318. ----
  319. .. _class_Theme_method_get_theme_item_list:
  320. - :ref:`PackedStringArray<class_PackedStringArray>` **get_theme_item_list** **(** :ref:`DataType<enum_Theme_DataType>` data_type, :ref:`String<class_String>` theme_type **)** |const|
  321. Returns all the theme items of ``data_type`` as a :ref:`PackedStringArray<class_PackedStringArray>` filled with each theme items's name, for use in :ref:`get_theme_item<class_Theme_method_get_theme_item>` or a data type specific method, if the theme has ``theme_type``.
  322. Valid ``theme_type``\ s may be found using :ref:`get_theme_item_type_list<class_Theme_method_get_theme_item_type_list>` or a data type specific method.
  323. ----
  324. .. _class_Theme_method_get_theme_item_type_list:
  325. - :ref:`PackedStringArray<class_PackedStringArray>` **get_theme_item_type_list** **(** :ref:`DataType<enum_Theme_DataType>` data_type **)** |const|
  326. Returns all the theme items of ``data_type`` types as a :ref:`PackedStringArray<class_PackedStringArray>` filled with unique type names, for use in :ref:`get_theme_item<class_Theme_method_get_theme_item>`, :ref:`get_theme_item_list<class_Theme_method_get_theme_item_list>` or data type specific methods.
  327. ----
  328. .. _class_Theme_method_get_type_list:
  329. - :ref:`PackedStringArray<class_PackedStringArray>` **get_type_list** **(** **)** |const|
  330. Returns all the theme types as a :ref:`PackedStringArray<class_PackedStringArray>` filled with unique type names, for use in other ``get_*`` functions of this theme.
  331. ----
  332. .. _class_Theme_method_get_type_variation_base:
  333. - :ref:`StringName<class_StringName>` **get_type_variation_base** **(** :ref:`StringName<class_StringName>` theme_type **)** |const|
  334. Returns the base theme type if ``theme_type`` is a valid variation type. Returns an empty string otherwise.
  335. ----
  336. .. _class_Theme_method_get_type_variation_list:
  337. - :ref:`PackedStringArray<class_PackedStringArray>` **get_type_variation_list** **(** :ref:`StringName<class_StringName>` base_type **)** |const|
  338. Returns a list of all variation for the given ``base_type``.
  339. ----
  340. .. _class_Theme_method_has_color:
  341. - :ref:`bool<class_bool>` **has_color** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |const|
  342. Returns ``true`` if :ref:`Color<class_Color>` with ``name`` is in ``theme_type``.
  343. Returns ``false`` if the theme does not have ``theme_type``.
  344. ----
  345. .. _class_Theme_method_has_constant:
  346. - :ref:`bool<class_bool>` **has_constant** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |const|
  347. Returns ``true`` if constant with ``name`` is in ``theme_type``.
  348. Returns ``false`` if the theme does not have ``theme_type``.
  349. ----
  350. .. _class_Theme_method_has_default_base_scale:
  351. - :ref:`bool<class_bool>` **has_default_base_scale** **(** **)** |const|
  352. Returns ``true`` if this theme has a valid :ref:`default_base_scale<class_Theme_property_default_base_scale>` value.
  353. ----
  354. .. _class_Theme_method_has_default_font:
  355. - :ref:`bool<class_bool>` **has_default_font** **(** **)** |const|
  356. Returns ``true`` if this theme has a valid :ref:`default_font<class_Theme_property_default_font>` value.
  357. ----
  358. .. _class_Theme_method_has_default_font_size:
  359. - :ref:`bool<class_bool>` **has_default_font_size** **(** **)** |const|
  360. Returns ``true`` if this theme has a valid :ref:`default_font_size<class_Theme_property_default_font_size>` value.
  361. ----
  362. .. _class_Theme_method_has_font:
  363. - :ref:`bool<class_bool>` **has_font** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |const|
  364. Returns ``true`` if :ref:`Font<class_Font>` with ``name`` is in ``theme_type``.
  365. Returns ``false`` if the theme does not have ``theme_type``.
  366. ----
  367. .. _class_Theme_method_has_font_size:
  368. - :ref:`bool<class_bool>` **has_font_size** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |const|
  369. Returns ``true`` if font size with ``name`` is in ``theme_type``.
  370. Returns ``false`` if the theme does not have ``theme_type``.
  371. ----
  372. .. _class_Theme_method_has_icon:
  373. - :ref:`bool<class_bool>` **has_icon** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |const|
  374. Returns ``true`` if icon :ref:`Texture2D<class_Texture2D>` with ``name`` is in ``theme_type``.
  375. Returns ``false`` if the theme does not have ``theme_type``.
  376. ----
  377. .. _class_Theme_method_has_stylebox:
  378. - :ref:`bool<class_bool>` **has_stylebox** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |const|
  379. Returns ``true`` if :ref:`StyleBox<class_StyleBox>` with ``name`` is in ``theme_type``.
  380. Returns ``false`` if the theme does not have ``theme_type``.
  381. ----
  382. .. _class_Theme_method_has_theme_item:
  383. - :ref:`bool<class_bool>` **has_theme_item** **(** :ref:`DataType<enum_Theme_DataType>` data_type, :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)** |const|
  384. Returns ``true`` if a theme item of ``data_type`` with ``name`` is in ``theme_type``.
  385. Returns ``false`` if the theme does not have ``theme_type``.
  386. ----
  387. .. _class_Theme_method_is_type_variation:
  388. - :ref:`bool<class_bool>` **is_type_variation** **(** :ref:`StringName<class_StringName>` theme_type, :ref:`StringName<class_StringName>` base_type **)** |const|
  389. Returns ``true`` if ``theme_type`` is marked as a variation of ``base_type`` in this theme.
  390. ----
  391. .. _class_Theme_method_merge_with:
  392. - void **merge_with** **(** :ref:`Theme<class_Theme>` other **)**
  393. Adds missing and overrides existing definitions with values from the ``other`` ``Theme``.
  394. **Note:** This modifies the current theme. If you want to merge two themes together without modifying either one, create a new empty theme and merge the other two into it one after another.
  395. ----
  396. .. _class_Theme_method_rename_color:
  397. - void **rename_color** **(** :ref:`StringName<class_StringName>` old_name, :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)**
  398. Renames the :ref:`Color<class_Color>` at ``old_name`` to ``name`` if the theme has ``theme_type``. If ``name`` is already taken, this method fails.
  399. ----
  400. .. _class_Theme_method_rename_constant:
  401. - void **rename_constant** **(** :ref:`StringName<class_StringName>` old_name, :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)**
  402. Renames the constant at ``old_name`` to ``name`` if the theme has ``theme_type``. If ``name`` is already taken, this method fails.
  403. ----
  404. .. _class_Theme_method_rename_font:
  405. - void **rename_font** **(** :ref:`StringName<class_StringName>` old_name, :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)**
  406. Renames the :ref:`Font<class_Font>` at ``old_name`` to ``name`` if the theme has ``theme_type``. If ``name`` is already taken, this method fails.
  407. ----
  408. .. _class_Theme_method_rename_font_size:
  409. - void **rename_font_size** **(** :ref:`StringName<class_StringName>` old_name, :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)**
  410. Renames the font size ``old_name`` to ``name`` if the theme has ``theme_type``. If ``name`` is already taken, this method fails.
  411. ----
  412. .. _class_Theme_method_rename_icon:
  413. - void **rename_icon** **(** :ref:`StringName<class_StringName>` old_name, :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)**
  414. Renames the icon at ``old_name`` to ``name`` if the theme has ``theme_type``. If ``name`` is already taken, this method fails.
  415. ----
  416. .. _class_Theme_method_rename_stylebox:
  417. - void **rename_stylebox** **(** :ref:`StringName<class_StringName>` old_name, :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)**
  418. Renames :ref:`StyleBox<class_StyleBox>` at ``old_name`` to ``name`` if the theme has ``theme_type``. If ``name`` is already taken, this method fails.
  419. ----
  420. .. _class_Theme_method_rename_theme_item:
  421. - void **rename_theme_item** **(** :ref:`DataType<enum_Theme_DataType>` data_type, :ref:`StringName<class_StringName>` old_name, :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type **)**
  422. Renames the theme item of ``data_type`` at ``old_name`` to ``name`` if the theme has ``theme_type``. If ``name`` is already taken, this method fails.
  423. ----
  424. .. _class_Theme_method_set_color:
  425. - void **set_color** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type, :ref:`Color<class_Color>` color **)**
  426. Sets the theme's :ref:`Color<class_Color>` to ``color`` at ``name`` in ``theme_type``.
  427. Creates ``theme_type`` if the theme does not have it.
  428. ----
  429. .. _class_Theme_method_set_constant:
  430. - void **set_constant** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type, :ref:`int<class_int>` constant **)**
  431. Sets the theme's constant to ``constant`` at ``name`` in ``theme_type``.
  432. Creates ``theme_type`` if the theme does not have it.
  433. ----
  434. .. _class_Theme_method_set_font:
  435. - void **set_font** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type, :ref:`Font<class_Font>` font **)**
  436. Sets the theme's :ref:`Font<class_Font>` to ``font`` at ``name`` in ``theme_type``.
  437. Creates ``theme_type`` if the theme does not have it.
  438. ----
  439. .. _class_Theme_method_set_font_size:
  440. - void **set_font_size** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type, :ref:`int<class_int>` font_size **)**
  441. Sets the theme's font size to ``font_size`` at ``name`` in ``theme_type``.
  442. Creates ``theme_type`` if the theme does not have it.
  443. ----
  444. .. _class_Theme_method_set_icon:
  445. - void **set_icon** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type, :ref:`Texture2D<class_Texture2D>` texture **)**
  446. Sets the theme's icon :ref:`Texture2D<class_Texture2D>` to ``texture`` at ``name`` in ``theme_type``.
  447. Creates ``theme_type`` if the theme does not have it.
  448. ----
  449. .. _class_Theme_method_set_stylebox:
  450. - void **set_stylebox** **(** :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type, :ref:`StyleBox<class_StyleBox>` texture **)**
  451. Sets theme's :ref:`StyleBox<class_StyleBox>` to ``stylebox`` at ``name`` in ``theme_type``.
  452. Creates ``theme_type`` if the theme does not have it.
  453. ----
  454. .. _class_Theme_method_set_theme_item:
  455. - void **set_theme_item** **(** :ref:`DataType<enum_Theme_DataType>` data_type, :ref:`StringName<class_StringName>` name, :ref:`StringName<class_StringName>` theme_type, :ref:`Variant<class_Variant>` value **)**
  456. Sets the theme item of ``data_type`` to ``value`` at ``name`` in ``theme_type``.
  457. Does nothing if the ``value`` type does not match ``data_type``.
  458. Creates ``theme_type`` if the theme does not have it.
  459. ----
  460. .. _class_Theme_method_set_type_variation:
  461. - void **set_type_variation** **(** :ref:`StringName<class_StringName>` theme_type, :ref:`StringName<class_StringName>` base_type **)**
  462. Marks ``theme_type`` as being a variation of ``base_type``.
  463. This adds ``theme_type`` as a suggested option for :ref:`Control.theme_type_variation<class_Control_property_theme_type_variation>` on a :ref:`Control<class_Control>` that is of the ``base_type`` class.
  464. Variations can also be nested, i.e. ``base_type`` can be another variation. If a chain of variations ends with a ``base_type`` matching a class of a :ref:`Control<class_Control>`, the whole chain is going to be suggested as options.
  465. **Note:** Suggestions only show up if this ``Theme`` is set as the project default theme. See :ref:`ProjectSettings.gui/theme/custom<class_ProjectSettings_property_gui/theme/custom>`.
  466. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  467. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  468. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  469. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  470. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  471. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`