class_theme.rst 46 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610
  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:`Reference<class_Reference>` **<** :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:`../tutorials/ui/gui_skinning`
  17. Properties
  18. ----------
  19. +-------------------------+--------------------------------------------------------+
  20. | :ref:`Font<class_Font>` | :ref:`default_font<class_Theme_property_default_font>` |
  21. +-------------------------+--------------------------------------------------------+
  22. Methods
  23. -------
  24. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  25. | void | :ref:`clear<class_Theme_method_clear>` **(** **)** |
  26. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  27. | void | :ref:`clear_color<class_Theme_method_clear_color>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` node_type **)** |
  28. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  29. | void | :ref:`clear_constant<class_Theme_method_clear_constant>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` node_type **)** |
  30. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  31. | void | :ref:`clear_font<class_Theme_method_clear_font>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` node_type **)** |
  32. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  33. | void | :ref:`clear_icon<class_Theme_method_clear_icon>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` node_type **)** |
  34. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  35. | void | :ref:`clear_stylebox<class_Theme_method_clear_stylebox>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` node_type **)** |
  36. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  37. | void | :ref:`clear_theme_item<class_Theme_method_clear_theme_item>` **(** :ref:`DataType<enum_Theme_DataType>` data_type, :ref:`String<class_String>` name, :ref:`String<class_String>` node_type **)** |
  38. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  39. | void | :ref:`copy_default_theme<class_Theme_method_copy_default_theme>` **(** **)** |
  40. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  41. | void | :ref:`copy_theme<class_Theme_method_copy_theme>` **(** :ref:`Theme<class_Theme>` other **)** |
  42. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  43. | :ref:`Color<class_Color>` | :ref:`get_color<class_Theme_method_get_color>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` node_type **)** |const| |
  44. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  45. | :ref:`PoolStringArray<class_PoolStringArray>` | :ref:`get_color_list<class_Theme_method_get_color_list>` **(** :ref:`String<class_String>` node_type **)** |const| |
  46. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  47. | :ref:`PoolStringArray<class_PoolStringArray>` | :ref:`get_color_types<class_Theme_method_get_color_types>` **(** **)** |const| |
  48. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  49. | :ref:`int<class_int>` | :ref:`get_constant<class_Theme_method_get_constant>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` node_type **)** |const| |
  50. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  51. | :ref:`PoolStringArray<class_PoolStringArray>` | :ref:`get_constant_list<class_Theme_method_get_constant_list>` **(** :ref:`String<class_String>` node_type **)** |const| |
  52. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  53. | :ref:`PoolStringArray<class_PoolStringArray>` | :ref:`get_constant_types<class_Theme_method_get_constant_types>` **(** **)** |const| |
  54. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  55. | :ref:`Font<class_Font>` | :ref:`get_font<class_Theme_method_get_font>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` node_type **)** |const| |
  56. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  57. | :ref:`PoolStringArray<class_PoolStringArray>` | :ref:`get_font_list<class_Theme_method_get_font_list>` **(** :ref:`String<class_String>` node_type **)** |const| |
  58. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  59. | :ref:`PoolStringArray<class_PoolStringArray>` | :ref:`get_font_types<class_Theme_method_get_font_types>` **(** **)** |const| |
  60. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  61. | :ref:`Texture<class_Texture>` | :ref:`get_icon<class_Theme_method_get_icon>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` node_type **)** |const| |
  62. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  63. | :ref:`PoolStringArray<class_PoolStringArray>` | :ref:`get_icon_list<class_Theme_method_get_icon_list>` **(** :ref:`String<class_String>` node_type **)** |const| |
  64. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  65. | :ref:`PoolStringArray<class_PoolStringArray>` | :ref:`get_icon_types<class_Theme_method_get_icon_types>` **(** **)** |const| |
  66. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  67. | :ref:`StyleBox<class_StyleBox>` | :ref:`get_stylebox<class_Theme_method_get_stylebox>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` node_type **)** |const| |
  68. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  69. | :ref:`PoolStringArray<class_PoolStringArray>` | :ref:`get_stylebox_list<class_Theme_method_get_stylebox_list>` **(** :ref:`String<class_String>` node_type **)** |const| |
  70. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  71. | :ref:`PoolStringArray<class_PoolStringArray>` | :ref:`get_stylebox_types<class_Theme_method_get_stylebox_types>` **(** **)** |const| |
  72. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  73. | :ref:`Variant<class_Variant>` | :ref:`get_theme_item<class_Theme_method_get_theme_item>` **(** :ref:`DataType<enum_Theme_DataType>` data_type, :ref:`String<class_String>` name, :ref:`String<class_String>` node_type **)** |const| |
  74. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  75. | :ref:`PoolStringArray<class_PoolStringArray>` | :ref:`get_theme_item_list<class_Theme_method_get_theme_item_list>` **(** :ref:`DataType<enum_Theme_DataType>` data_type, :ref:`String<class_String>` node_type **)** |const| |
  76. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  77. | :ref:`PoolStringArray<class_PoolStringArray>` | :ref:`get_theme_item_types<class_Theme_method_get_theme_item_types>` **(** :ref:`DataType<enum_Theme_DataType>` data_type **)** |const| |
  78. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  79. | :ref:`PoolStringArray<class_PoolStringArray>` | :ref:`get_type_list<class_Theme_method_get_type_list>` **(** :ref:`String<class_String>` node_type **)** |const| |
  80. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  81. | :ref:`bool<class_bool>` | :ref:`has_color<class_Theme_method_has_color>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` node_type **)** |const| |
  82. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  83. | :ref:`bool<class_bool>` | :ref:`has_constant<class_Theme_method_has_constant>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` node_type **)** |const| |
  84. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  85. | :ref:`bool<class_bool>` | :ref:`has_default_font<class_Theme_method_has_default_font>` **(** **)** |const| |
  86. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  87. | :ref:`bool<class_bool>` | :ref:`has_font<class_Theme_method_has_font>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` node_type **)** |const| |
  88. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  89. | :ref:`bool<class_bool>` | :ref:`has_icon<class_Theme_method_has_icon>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` node_type **)** |const| |
  90. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  91. | :ref:`bool<class_bool>` | :ref:`has_stylebox<class_Theme_method_has_stylebox>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` node_type **)** |const| |
  92. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  93. | :ref:`bool<class_bool>` | :ref:`has_theme_item<class_Theme_method_has_theme_item>` **(** :ref:`DataType<enum_Theme_DataType>` data_type, :ref:`String<class_String>` name, :ref:`String<class_String>` node_type **)** |const| |
  94. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  95. | void | :ref:`merge_with<class_Theme_method_merge_with>` **(** :ref:`Theme<class_Theme>` other **)** |
  96. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  97. | void | :ref:`rename_color<class_Theme_method_rename_color>` **(** :ref:`String<class_String>` old_name, :ref:`String<class_String>` name, :ref:`String<class_String>` node_type **)** |
  98. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  99. | void | :ref:`rename_constant<class_Theme_method_rename_constant>` **(** :ref:`String<class_String>` old_name, :ref:`String<class_String>` name, :ref:`String<class_String>` node_type **)** |
  100. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  101. | void | :ref:`rename_font<class_Theme_method_rename_font>` **(** :ref:`String<class_String>` old_name, :ref:`String<class_String>` name, :ref:`String<class_String>` node_type **)** |
  102. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  103. | void | :ref:`rename_icon<class_Theme_method_rename_icon>` **(** :ref:`String<class_String>` old_name, :ref:`String<class_String>` name, :ref:`String<class_String>` node_type **)** |
  104. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  105. | void | :ref:`rename_stylebox<class_Theme_method_rename_stylebox>` **(** :ref:`String<class_String>` old_name, :ref:`String<class_String>` name, :ref:`String<class_String>` node_type **)** |
  106. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  107. | void | :ref:`rename_theme_item<class_Theme_method_rename_theme_item>` **(** :ref:`DataType<enum_Theme_DataType>` data_type, :ref:`String<class_String>` old_name, :ref:`String<class_String>` name, :ref:`String<class_String>` node_type **)** |
  108. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  109. | void | :ref:`set_color<class_Theme_method_set_color>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` node_type, :ref:`Color<class_Color>` color **)** |
  110. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  111. | void | :ref:`set_constant<class_Theme_method_set_constant>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` node_type, :ref:`int<class_int>` constant **)** |
  112. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  113. | void | :ref:`set_font<class_Theme_method_set_font>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` node_type, :ref:`Font<class_Font>` font **)** |
  114. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  115. | void | :ref:`set_icon<class_Theme_method_set_icon>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` node_type, :ref:`Texture<class_Texture>` texture **)** |
  116. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  117. | void | :ref:`set_stylebox<class_Theme_method_set_stylebox>` **(** :ref:`String<class_String>` name, :ref:`String<class_String>` node_type, :ref:`StyleBox<class_StyleBox>` texture **)** |
  118. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  119. | void | :ref:`set_theme_item<class_Theme_method_set_theme_item>` **(** :ref:`DataType<enum_Theme_DataType>` data_type, :ref:`String<class_String>` name, :ref:`String<class_String>` node_type, :ref:`Variant<class_Variant>` value **)** |
  120. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  121. Enumerations
  122. ------------
  123. .. _enum_Theme_DataType:
  124. .. _class_Theme_constant_DATA_TYPE_COLOR:
  125. .. _class_Theme_constant_DATA_TYPE_CONSTANT:
  126. .. _class_Theme_constant_DATA_TYPE_FONT:
  127. .. _class_Theme_constant_DATA_TYPE_ICON:
  128. .. _class_Theme_constant_DATA_TYPE_STYLEBOX:
  129. .. _class_Theme_constant_DATA_TYPE_MAX:
  130. enum **DataType**:
  131. - **DATA_TYPE_COLOR** = **0** --- Theme's :ref:`Color<class_Color>` item type.
  132. - **DATA_TYPE_CONSTANT** = **1** --- Theme's constant item type.
  133. - **DATA_TYPE_FONT** = **2** --- Theme's :ref:`Font<class_Font>` item type.
  134. - **DATA_TYPE_ICON** = **3** --- Theme's icon :ref:`Texture<class_Texture>` item type.
  135. - **DATA_TYPE_STYLEBOX** = **4** --- Theme's :ref:`StyleBox<class_StyleBox>` item type.
  136. - **DATA_TYPE_MAX** = **5** --- Maximum value for the DataType enum.
  137. Property Descriptions
  138. ---------------------
  139. .. _class_Theme_property_default_font:
  140. - :ref:`Font<class_Font>` **default_font**
  141. +----------+-------------------------+
  142. | *Setter* | set_default_font(value) |
  143. +----------+-------------------------+
  144. | *Getter* | get_default_font() |
  145. +----------+-------------------------+
  146. 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.
  147. Use :ref:`has_default_font<class_Theme_method_has_default_font>` to check if this value is valid.
  148. Method Descriptions
  149. -------------------
  150. .. _class_Theme_method_clear:
  151. - void **clear** **(** **)**
  152. Clears all values on the theme.
  153. ----
  154. .. _class_Theme_method_clear_color:
  155. - void **clear_color** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` node_type **)**
  156. Clears the :ref:`Color<class_Color>` at ``name`` if the theme has ``node_type``.
  157. ----
  158. .. _class_Theme_method_clear_constant:
  159. - void **clear_constant** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` node_type **)**
  160. Clears the constant at ``name`` if the theme has ``node_type``.
  161. ----
  162. .. _class_Theme_method_clear_font:
  163. - void **clear_font** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` node_type **)**
  164. Clears the :ref:`Font<class_Font>` at ``name`` if the theme has ``node_type``.
  165. ----
  166. .. _class_Theme_method_clear_icon:
  167. - void **clear_icon** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` node_type **)**
  168. Clears the icon at ``name`` if the theme has ``node_type``.
  169. ----
  170. .. _class_Theme_method_clear_stylebox:
  171. - void **clear_stylebox** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` node_type **)**
  172. Clears :ref:`StyleBox<class_StyleBox>` at ``name`` if the theme has ``node_type``.
  173. ----
  174. .. _class_Theme_method_clear_theme_item:
  175. - void **clear_theme_item** **(** :ref:`DataType<enum_Theme_DataType>` data_type, :ref:`String<class_String>` name, :ref:`String<class_String>` node_type **)**
  176. Clears the theme item of ``data_type`` at ``name`` if the theme has ``node_type``.
  177. ----
  178. .. _class_Theme_method_copy_default_theme:
  179. - void **copy_default_theme** **(** **)**
  180. Sets the theme's values to a copy of the default theme values.
  181. ----
  182. .. _class_Theme_method_copy_theme:
  183. - void **copy_theme** **(** :ref:`Theme<class_Theme>` other **)**
  184. Sets the theme's values to a copy of a given theme.
  185. ----
  186. .. _class_Theme_method_get_color:
  187. - :ref:`Color<class_Color>` **get_color** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` node_type **)** |const|
  188. Returns the :ref:`Color<class_Color>` at ``name`` if the theme has ``node_type``.
  189. ----
  190. .. _class_Theme_method_get_color_list:
  191. - :ref:`PoolStringArray<class_PoolStringArray>` **get_color_list** **(** :ref:`String<class_String>` node_type **)** |const|
  192. Returns all the :ref:`Color<class_Color>`\ s as a :ref:`PoolStringArray<class_PoolStringArray>` filled with each :ref:`Color<class_Color>`'s name, for use in :ref:`get_color<class_Theme_method_get_color>`, if the theme has ``node_type``.
  193. ----
  194. .. _class_Theme_method_get_color_types:
  195. - :ref:`PoolStringArray<class_PoolStringArray>` **get_color_types** **(** **)** |const|
  196. Returns all the :ref:`Color<class_Color>` types as a :ref:`PoolStringArray<class_PoolStringArray>` 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>`.
  197. ----
  198. .. _class_Theme_method_get_constant:
  199. - :ref:`int<class_int>` **get_constant** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` node_type **)** |const|
  200. Returns the constant at ``name`` if the theme has ``node_type``.
  201. ----
  202. .. _class_Theme_method_get_constant_list:
  203. - :ref:`PoolStringArray<class_PoolStringArray>` **get_constant_list** **(** :ref:`String<class_String>` node_type **)** |const|
  204. Returns all the constants as a :ref:`PoolStringArray<class_PoolStringArray>` filled with each constant's name, for use in :ref:`get_constant<class_Theme_method_get_constant>`, if the theme has ``node_type``.
  205. ----
  206. .. _class_Theme_method_get_constant_types:
  207. - :ref:`PoolStringArray<class_PoolStringArray>` **get_constant_types** **(** **)** |const|
  208. Returns all the constant types as a :ref:`PoolStringArray<class_PoolStringArray>` 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>`.
  209. ----
  210. .. _class_Theme_method_get_font:
  211. - :ref:`Font<class_Font>` **get_font** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` node_type **)** |const|
  212. Returns the :ref:`Font<class_Font>` at ``name`` if the theme has ``node_type``.
  213. ----
  214. .. _class_Theme_method_get_font_list:
  215. - :ref:`PoolStringArray<class_PoolStringArray>` **get_font_list** **(** :ref:`String<class_String>` node_type **)** |const|
  216. Returns all the :ref:`Font<class_Font>`\ s as a :ref:`PoolStringArray<class_PoolStringArray>` filled with each :ref:`Font<class_Font>`'s name, for use in :ref:`get_font<class_Theme_method_get_font>`, if the theme has ``node_type``.
  217. ----
  218. .. _class_Theme_method_get_font_types:
  219. - :ref:`PoolStringArray<class_PoolStringArray>` **get_font_types** **(** **)** |const|
  220. Returns all the :ref:`Font<class_Font>` types as a :ref:`PoolStringArray<class_PoolStringArray>` 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>`.
  221. ----
  222. .. _class_Theme_method_get_icon:
  223. - :ref:`Texture<class_Texture>` **get_icon** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` node_type **)** |const|
  224. Returns the icon :ref:`Texture<class_Texture>` at ``name`` if the theme has ``node_type``.
  225. ----
  226. .. _class_Theme_method_get_icon_list:
  227. - :ref:`PoolStringArray<class_PoolStringArray>` **get_icon_list** **(** :ref:`String<class_String>` node_type **)** |const|
  228. Returns all the icons as a :ref:`PoolStringArray<class_PoolStringArray>` filled with each :ref:`Texture<class_Texture>`'s name, for use in :ref:`get_icon<class_Theme_method_get_icon>`, if the theme has ``node_type``.
  229. ----
  230. .. _class_Theme_method_get_icon_types:
  231. - :ref:`PoolStringArray<class_PoolStringArray>` **get_icon_types** **(** **)** |const|
  232. Returns all the icon types as a :ref:`PoolStringArray<class_PoolStringArray>` 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>`.
  233. ----
  234. .. _class_Theme_method_get_stylebox:
  235. - :ref:`StyleBox<class_StyleBox>` **get_stylebox** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` node_type **)** |const|
  236. Returns the :ref:`StyleBox<class_StyleBox>` at ``name`` if the theme has ``node_type``.
  237. Valid ``name``\ s may be found using :ref:`get_stylebox_list<class_Theme_method_get_stylebox_list>`. Valid ``node_type``\ s may be found using :ref:`get_stylebox_types<class_Theme_method_get_stylebox_types>`.
  238. ----
  239. .. _class_Theme_method_get_stylebox_list:
  240. - :ref:`PoolStringArray<class_PoolStringArray>` **get_stylebox_list** **(** :ref:`String<class_String>` node_type **)** |const|
  241. Returns all the :ref:`StyleBox<class_StyleBox>`\ s as a :ref:`PoolStringArray<class_PoolStringArray>` filled with each :ref:`StyleBox<class_StyleBox>`'s name, for use in :ref:`get_stylebox<class_Theme_method_get_stylebox>`, if the theme has ``node_type``.
  242. Valid ``node_type``\ s may be found using :ref:`get_stylebox_types<class_Theme_method_get_stylebox_types>`.
  243. ----
  244. .. _class_Theme_method_get_stylebox_types:
  245. - :ref:`PoolStringArray<class_PoolStringArray>` **get_stylebox_types** **(** **)** |const|
  246. Returns all the :ref:`StyleBox<class_StyleBox>` types as a :ref:`PoolStringArray<class_PoolStringArray>` 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>`.
  247. ----
  248. .. _class_Theme_method_get_theme_item:
  249. - :ref:`Variant<class_Variant>` **get_theme_item** **(** :ref:`DataType<enum_Theme_DataType>` data_type, :ref:`String<class_String>` name, :ref:`String<class_String>` node_type **)** |const|
  250. Returns the theme item of ``data_type`` at ``name`` if the theme has ``node_type``.
  251. 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 ``node_type``\ s may be found using :ref:`get_theme_item_types<class_Theme_method_get_theme_item_types>` or a data type specific method.
  252. ----
  253. .. _class_Theme_method_get_theme_item_list:
  254. - :ref:`PoolStringArray<class_PoolStringArray>` **get_theme_item_list** **(** :ref:`DataType<enum_Theme_DataType>` data_type, :ref:`String<class_String>` node_type **)** |const|
  255. Returns all the theme items of ``data_type`` as a :ref:`PoolStringArray<class_PoolStringArray>` 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 ``node_type``.
  256. Valid ``node_type``\ s may be found using :ref:`get_theme_item_types<class_Theme_method_get_theme_item_types>` or a data type specific method.
  257. ----
  258. .. _class_Theme_method_get_theme_item_types:
  259. - :ref:`PoolStringArray<class_PoolStringArray>` **get_theme_item_types** **(** :ref:`DataType<enum_Theme_DataType>` data_type **)** |const|
  260. Returns all the theme items of ``data_type`` types as a :ref:`PoolStringArray<class_PoolStringArray>` 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.
  261. ----
  262. .. _class_Theme_method_get_type_list:
  263. - :ref:`PoolStringArray<class_PoolStringArray>` **get_type_list** **(** :ref:`String<class_String>` node_type **)** |const|
  264. Returns all the theme types as a :ref:`PoolStringArray<class_PoolStringArray>` filled with unique type names, for use in other ``get_*`` functions of this theme.
  265. **Note:** ``node_type`` has no effect and will be removed in future version.
  266. ----
  267. .. _class_Theme_method_has_color:
  268. - :ref:`bool<class_bool>` **has_color** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` node_type **)** |const|
  269. Returns ``true`` if :ref:`Color<class_Color>` with ``name`` is in ``node_type``.
  270. Returns ``false`` if the theme does not have ``node_type``.
  271. ----
  272. .. _class_Theme_method_has_constant:
  273. - :ref:`bool<class_bool>` **has_constant** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` node_type **)** |const|
  274. Returns ``true`` if constant with ``name`` is in ``node_type``.
  275. Returns ``false`` if the theme does not have ``node_type``.
  276. ----
  277. .. _class_Theme_method_has_default_font:
  278. - :ref:`bool<class_bool>` **has_default_font** **(** **)** |const|
  279. Returns ``true`` if this theme has a valid :ref:`default_font<class_Theme_property_default_font>` value.
  280. ----
  281. .. _class_Theme_method_has_font:
  282. - :ref:`bool<class_bool>` **has_font** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` node_type **)** |const|
  283. Returns ``true`` if :ref:`Font<class_Font>` with ``name`` is in ``node_type``.
  284. Returns ``false`` if the theme does not have ``node_type``.
  285. ----
  286. .. _class_Theme_method_has_icon:
  287. - :ref:`bool<class_bool>` **has_icon** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` node_type **)** |const|
  288. Returns ``true`` if icon :ref:`Texture<class_Texture>` with ``name`` is in ``node_type``.
  289. Returns ``false`` if the theme does not have ``node_type``.
  290. ----
  291. .. _class_Theme_method_has_stylebox:
  292. - :ref:`bool<class_bool>` **has_stylebox** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` node_type **)** |const|
  293. Returns ``true`` if :ref:`StyleBox<class_StyleBox>` with ``name`` is in ``node_type``.
  294. Returns ``false`` if the theme does not have ``node_type``.
  295. ----
  296. .. _class_Theme_method_has_theme_item:
  297. - :ref:`bool<class_bool>` **has_theme_item** **(** :ref:`DataType<enum_Theme_DataType>` data_type, :ref:`String<class_String>` name, :ref:`String<class_String>` node_type **)** |const|
  298. Returns ``true`` if a theme item of ``data_type`` with ``name`` is in ``node_type``.
  299. Returns ``false`` if the theme does not have ``node_type``.
  300. ----
  301. .. _class_Theme_method_merge_with:
  302. - void **merge_with** **(** :ref:`Theme<class_Theme>` other **)**
  303. Adds missing and overrides existing definitions with values from the ``other`` ``Theme``.
  304. **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.
  305. ----
  306. .. _class_Theme_method_rename_color:
  307. - void **rename_color** **(** :ref:`String<class_String>` old_name, :ref:`String<class_String>` name, :ref:`String<class_String>` node_type **)**
  308. Renames the :ref:`Color<class_Color>` at ``old_name`` to ``name`` if the theme has ``node_type``. If ``name`` is already taken, this method fails.
  309. ----
  310. .. _class_Theme_method_rename_constant:
  311. - void **rename_constant** **(** :ref:`String<class_String>` old_name, :ref:`String<class_String>` name, :ref:`String<class_String>` node_type **)**
  312. Renames the constant at ``old_name`` to ``name`` if the theme has ``node_type``. If ``name`` is already taken, this method fails.
  313. ----
  314. .. _class_Theme_method_rename_font:
  315. - void **rename_font** **(** :ref:`String<class_String>` old_name, :ref:`String<class_String>` name, :ref:`String<class_String>` node_type **)**
  316. Renames the :ref:`Font<class_Font>` at ``old_name`` to ``name`` if the theme has ``node_type``. If ``name`` is already taken, this method fails.
  317. ----
  318. .. _class_Theme_method_rename_icon:
  319. - void **rename_icon** **(** :ref:`String<class_String>` old_name, :ref:`String<class_String>` name, :ref:`String<class_String>` node_type **)**
  320. Renames the icon at ``old_name`` to ``name`` if the theme has ``node_type``. If ``name`` is already taken, this method fails.
  321. ----
  322. .. _class_Theme_method_rename_stylebox:
  323. - void **rename_stylebox** **(** :ref:`String<class_String>` old_name, :ref:`String<class_String>` name, :ref:`String<class_String>` node_type **)**
  324. Renames :ref:`StyleBox<class_StyleBox>` at ``old_name`` to ``name`` if the theme has ``node_type``. If ``name`` is already taken, this method fails.
  325. ----
  326. .. _class_Theme_method_rename_theme_item:
  327. - void **rename_theme_item** **(** :ref:`DataType<enum_Theme_DataType>` data_type, :ref:`String<class_String>` old_name, :ref:`String<class_String>` name, :ref:`String<class_String>` node_type **)**
  328. Renames the theme item of ``data_type`` at ``old_name`` to ``name`` if the theme has ``node_type``. If ``name`` is already taken, this method fails.
  329. ----
  330. .. _class_Theme_method_set_color:
  331. - void **set_color** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` node_type, :ref:`Color<class_Color>` color **)**
  332. Sets the theme's :ref:`Color<class_Color>` to ``color`` at ``name`` in ``node_type``.
  333. Creates ``node_type`` if the theme does not have it.
  334. ----
  335. .. _class_Theme_method_set_constant:
  336. - void **set_constant** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` node_type, :ref:`int<class_int>` constant **)**
  337. Sets the theme's constant to ``constant`` at ``name`` in ``node_type``.
  338. Creates ``node_type`` if the theme does not have it.
  339. ----
  340. .. _class_Theme_method_set_font:
  341. - void **set_font** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` node_type, :ref:`Font<class_Font>` font **)**
  342. Sets the theme's :ref:`Font<class_Font>` to ``font`` at ``name`` in ``node_type``.
  343. Creates ``node_type`` if the theme does not have it.
  344. ----
  345. .. _class_Theme_method_set_icon:
  346. - void **set_icon** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` node_type, :ref:`Texture<class_Texture>` texture **)**
  347. Sets the theme's icon :ref:`Texture<class_Texture>` to ``texture`` at ``name`` in ``node_type``.
  348. Creates ``node_type`` if the theme does not have it.
  349. ----
  350. .. _class_Theme_method_set_stylebox:
  351. - void **set_stylebox** **(** :ref:`String<class_String>` name, :ref:`String<class_String>` node_type, :ref:`StyleBox<class_StyleBox>` texture **)**
  352. Sets theme's :ref:`StyleBox<class_StyleBox>` to ``stylebox`` at ``name`` in ``node_type``.
  353. Creates ``node_type`` if the theme does not have it.
  354. ----
  355. .. _class_Theme_method_set_theme_item:
  356. - void **set_theme_item** **(** :ref:`DataType<enum_Theme_DataType>` data_type, :ref:`String<class_String>` name, :ref:`String<class_String>` node_type, :ref:`Variant<class_Variant>` value **)**
  357. Sets the theme item of ``data_type`` to ``value`` at ``name`` in ``node_type``.
  358. Does nothing if the ``value`` type does not match ``data_type``.
  359. Creates ``node_type`` if the theme does not have it.
  360. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  361. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  362. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`