Theme.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="Theme" inherits="Resource" version="3.4">
  3. <brief_description>
  4. Theme for controls.
  5. </brief_description>
  6. <description>
  7. 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 [Control]; the Control and its children will automatically use it.
  8. Theme resources can alternatively be loaded by writing them in a [code].theme[/code] file, see the documentation for more information.
  9. </description>
  10. <tutorials>
  11. <link>https://docs.godotengine.org/en/3.3/tutorials/gui/gui_skinning.html</link>
  12. </tutorials>
  13. <methods>
  14. <method name="clear">
  15. <return type="void">
  16. </return>
  17. <description>
  18. Clears all values on the theme.
  19. </description>
  20. </method>
  21. <method name="clear_color">
  22. <return type="void">
  23. </return>
  24. <argument index="0" name="name" type="String">
  25. </argument>
  26. <argument index="1" name="node_type" type="String">
  27. </argument>
  28. <description>
  29. Clears the [Color] at [code]name[/code] if the theme has [code]node_type[/code].
  30. </description>
  31. </method>
  32. <method name="clear_constant">
  33. <return type="void">
  34. </return>
  35. <argument index="0" name="name" type="String">
  36. </argument>
  37. <argument index="1" name="node_type" type="String">
  38. </argument>
  39. <description>
  40. Clears the constant at [code]name[/code] if the theme has [code]node_type[/code].
  41. </description>
  42. </method>
  43. <method name="clear_font">
  44. <return type="void">
  45. </return>
  46. <argument index="0" name="name" type="String">
  47. </argument>
  48. <argument index="1" name="node_type" type="String">
  49. </argument>
  50. <description>
  51. Clears the [Font] at [code]name[/code] if the theme has [code]node_type[/code].
  52. </description>
  53. </method>
  54. <method name="clear_icon">
  55. <return type="void">
  56. </return>
  57. <argument index="0" name="name" type="String">
  58. </argument>
  59. <argument index="1" name="node_type" type="String">
  60. </argument>
  61. <description>
  62. Clears the icon at [code]name[/code] if the theme has [code]node_type[/code].
  63. </description>
  64. </method>
  65. <method name="clear_stylebox">
  66. <return type="void">
  67. </return>
  68. <argument index="0" name="name" type="String">
  69. </argument>
  70. <argument index="1" name="node_type" type="String">
  71. </argument>
  72. <description>
  73. Clears [StyleBox] at [code]name[/code] if the theme has [code]node_type[/code].
  74. </description>
  75. </method>
  76. <method name="copy_default_theme">
  77. <return type="void">
  78. </return>
  79. <description>
  80. Sets the theme's values to a copy of the default theme values.
  81. </description>
  82. </method>
  83. <method name="copy_theme">
  84. <return type="void">
  85. </return>
  86. <argument index="0" name="other" type="Theme">
  87. </argument>
  88. <description>
  89. Sets the theme's values to a copy of a given theme.
  90. </description>
  91. </method>
  92. <method name="get_color" qualifiers="const">
  93. <return type="Color">
  94. </return>
  95. <argument index="0" name="name" type="String">
  96. </argument>
  97. <argument index="1" name="node_type" type="String">
  98. </argument>
  99. <description>
  100. Returns the [Color] at [code]name[/code] if the theme has [code]node_type[/code].
  101. </description>
  102. </method>
  103. <method name="get_color_list" qualifiers="const">
  104. <return type="PoolStringArray">
  105. </return>
  106. <argument index="0" name="node_type" type="String">
  107. </argument>
  108. <description>
  109. Returns all the [Color]s as a [PoolStringArray] filled with each [Color]'s name, for use in [method get_color], if the theme has [code]node_type[/code].
  110. </description>
  111. </method>
  112. <method name="get_constant" qualifiers="const">
  113. <return type="int">
  114. </return>
  115. <argument index="0" name="name" type="String">
  116. </argument>
  117. <argument index="1" name="node_type" type="String">
  118. </argument>
  119. <description>
  120. Returns the constant at [code]name[/code] if the theme has [code]node_type[/code].
  121. </description>
  122. </method>
  123. <method name="get_constant_list" qualifiers="const">
  124. <return type="PoolStringArray">
  125. </return>
  126. <argument index="0" name="node_type" type="String">
  127. </argument>
  128. <description>
  129. Returns all the constants as a [PoolStringArray] filled with each constant's name, for use in [method get_constant], if the theme has [code]node_type[/code].
  130. </description>
  131. </method>
  132. <method name="get_font" qualifiers="const">
  133. <return type="Font">
  134. </return>
  135. <argument index="0" name="name" type="String">
  136. </argument>
  137. <argument index="1" name="node_type" type="String">
  138. </argument>
  139. <description>
  140. Returns the [Font] at [code]name[/code] if the theme has [code]node_type[/code].
  141. </description>
  142. </method>
  143. <method name="get_font_list" qualifiers="const">
  144. <return type="PoolStringArray">
  145. </return>
  146. <argument index="0" name="node_type" type="String">
  147. </argument>
  148. <description>
  149. Returns all the [Font]s as a [PoolStringArray] filled with each [Font]'s name, for use in [method get_font], if the theme has [code]node_type[/code].
  150. </description>
  151. </method>
  152. <method name="get_icon" qualifiers="const">
  153. <return type="Texture">
  154. </return>
  155. <argument index="0" name="name" type="String">
  156. </argument>
  157. <argument index="1" name="node_type" type="String">
  158. </argument>
  159. <description>
  160. Returns the icon [Texture] at [code]name[/code] if the theme has [code]node_type[/code].
  161. </description>
  162. </method>
  163. <method name="get_icon_list" qualifiers="const">
  164. <return type="PoolStringArray">
  165. </return>
  166. <argument index="0" name="node_type" type="String">
  167. </argument>
  168. <description>
  169. Returns all the icons as a [PoolStringArray] filled with each [Texture]'s name, for use in [method get_icon], if the theme has [code]node_type[/code].
  170. </description>
  171. </method>
  172. <method name="get_stylebox" qualifiers="const">
  173. <return type="StyleBox">
  174. </return>
  175. <argument index="0" name="name" type="String">
  176. </argument>
  177. <argument index="1" name="node_type" type="String">
  178. </argument>
  179. <description>
  180. Returns the [StyleBox] at [code]name[/code] if the theme has [code]node_type[/code].
  181. Valid [code]name[/code]s may be found using [method get_stylebox_list]. Valid [code]node_type[/code]s may be found using [method get_stylebox_types].
  182. </description>
  183. </method>
  184. <method name="get_stylebox_list" qualifiers="const">
  185. <return type="PoolStringArray">
  186. </return>
  187. <argument index="0" name="node_type" type="String">
  188. </argument>
  189. <description>
  190. Returns all the [StyleBox]s as a [PoolStringArray] filled with each [StyleBox]'s name, for use in [method get_stylebox], if the theme has [code]node_type[/code].
  191. Valid [code]node_type[/code]s may be found using [method get_stylebox_types].
  192. </description>
  193. </method>
  194. <method name="get_stylebox_types" qualifiers="const">
  195. <return type="PoolStringArray">
  196. </return>
  197. <description>
  198. Returns all the [StyleBox] types as a [PoolStringArray] filled with each [StyleBox]'s type, for use in [method get_stylebox] and/or [method get_stylebox_list], if the theme has [code]node_type[/code].
  199. </description>
  200. </method>
  201. <method name="get_type_list" qualifiers="const">
  202. <return type="PoolStringArray">
  203. </return>
  204. <argument index="0" name="node_type" type="String">
  205. </argument>
  206. <description>
  207. Returns all the types in [code]node_type[/code] as a [PoolStringArray] for use in any of the [code]get_*[/code] functions, if the theme has [code]node_type[/code].
  208. </description>
  209. </method>
  210. <method name="has_color" qualifiers="const">
  211. <return type="bool">
  212. </return>
  213. <argument index="0" name="name" type="String">
  214. </argument>
  215. <argument index="1" name="node_type" type="String">
  216. </argument>
  217. <description>
  218. Returns [code]true[/code] if [Color] with [code]name[/code] is in [code]node_type[/code].
  219. Returns [code]false[/code] if the theme does not have [code]node_type[/code].
  220. </description>
  221. </method>
  222. <method name="has_constant" qualifiers="const">
  223. <return type="bool">
  224. </return>
  225. <argument index="0" name="name" type="String">
  226. </argument>
  227. <argument index="1" name="node_type" type="String">
  228. </argument>
  229. <description>
  230. Returns [code]true[/code] if constant with [code]name[/code] is in [code]node_type[/code].
  231. Returns [code]false[/code] if the theme does not have [code]node_type[/code].
  232. </description>
  233. </method>
  234. <method name="has_font" qualifiers="const">
  235. <return type="bool">
  236. </return>
  237. <argument index="0" name="name" type="String">
  238. </argument>
  239. <argument index="1" name="node_type" type="String">
  240. </argument>
  241. <description>
  242. Returns [code]true[/code] if [Font] with [code]name[/code] is in [code]node_type[/code].
  243. Returns [code]false[/code] if the theme does not have [code]node_type[/code].
  244. </description>
  245. </method>
  246. <method name="has_icon" qualifiers="const">
  247. <return type="bool">
  248. </return>
  249. <argument index="0" name="name" type="String">
  250. </argument>
  251. <argument index="1" name="node_type" type="String">
  252. </argument>
  253. <description>
  254. Returns [code]true[/code] if icon [Texture] with [code]name[/code] is in [code]node_type[/code].
  255. Returns [code]false[/code] if the theme does not have [code]node_type[/code].
  256. </description>
  257. </method>
  258. <method name="has_stylebox" qualifiers="const">
  259. <return type="bool">
  260. </return>
  261. <argument index="0" name="name" type="String">
  262. </argument>
  263. <argument index="1" name="node_type" type="String">
  264. </argument>
  265. <description>
  266. Returns [code]true[/code] if [StyleBox] with [code]name[/code] is in [code]node_type[/code].
  267. Returns [code]false[/code] if the theme does not have [code]node_type[/code].
  268. </description>
  269. </method>
  270. <method name="set_color">
  271. <return type="void">
  272. </return>
  273. <argument index="0" name="name" type="String">
  274. </argument>
  275. <argument index="1" name="node_type" type="String">
  276. </argument>
  277. <argument index="2" name="color" type="Color">
  278. </argument>
  279. <description>
  280. Sets the theme's [Color] to [code]color[/code] at [code]name[/code] in [code]node_type[/code].
  281. Does nothing if the theme does not have [code]node_type[/code].
  282. </description>
  283. </method>
  284. <method name="set_constant">
  285. <return type="void">
  286. </return>
  287. <argument index="0" name="name" type="String">
  288. </argument>
  289. <argument index="1" name="node_type" type="String">
  290. </argument>
  291. <argument index="2" name="constant" type="int">
  292. </argument>
  293. <description>
  294. Sets the theme's constant to [code]constant[/code] at [code]name[/code] in [code]node_type[/code].
  295. Does nothing if the theme does not have [code]node_type[/code].
  296. </description>
  297. </method>
  298. <method name="set_font">
  299. <return type="void">
  300. </return>
  301. <argument index="0" name="name" type="String">
  302. </argument>
  303. <argument index="1" name="node_type" type="String">
  304. </argument>
  305. <argument index="2" name="font" type="Font">
  306. </argument>
  307. <description>
  308. Sets the theme's [Font] to [code]font[/code] at [code]name[/code] in [code]node_type[/code].
  309. Does nothing if the theme does not have [code]node_type[/code].
  310. </description>
  311. </method>
  312. <method name="set_icon">
  313. <return type="void">
  314. </return>
  315. <argument index="0" name="name" type="String">
  316. </argument>
  317. <argument index="1" name="node_type" type="String">
  318. </argument>
  319. <argument index="2" name="texture" type="Texture">
  320. </argument>
  321. <description>
  322. Sets the theme's icon [Texture] to [code]texture[/code] at [code]name[/code] in [code]node_type[/code].
  323. Does nothing if the theme does not have [code]node_type[/code].
  324. </description>
  325. </method>
  326. <method name="set_stylebox">
  327. <return type="void">
  328. </return>
  329. <argument index="0" name="name" type="String">
  330. </argument>
  331. <argument index="1" name="node_type" type="String">
  332. </argument>
  333. <argument index="2" name="texture" type="StyleBox">
  334. </argument>
  335. <description>
  336. Sets theme's [StyleBox] to [code]stylebox[/code] at [code]name[/code] in [code]node_type[/code].
  337. Does nothing if the theme does not have [code]node_type[/code].
  338. </description>
  339. </method>
  340. </methods>
  341. <members>
  342. <member name="default_font" type="Font" setter="set_default_font" getter="get_default_font">
  343. The theme's default font.
  344. </member>
  345. </members>
  346. <constants>
  347. </constants>
  348. </class>