Theme.xml 11 KB

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