class_styleboxflat.rst 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the StyleBoxFlat.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_StyleBoxFlat:
  5. StyleBoxFlat
  6. ============
  7. **Inherits:** :ref:`StyleBox<class_StyleBox>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
  8. **Category:** Core
  9. Brief Description
  10. -----------------
  11. Customizable Stylebox with a given set of parameters. (no texture required)
  12. Properties
  13. ----------
  14. +---------------------------+-------------------------------------------------------------------------------------------+
  15. | :ref:`bool<class_bool>` | :ref:`anti_aliasing<class_StyleBoxFlat_property_anti_aliasing>` |
  16. +---------------------------+-------------------------------------------------------------------------------------------+
  17. | :ref:`int<class_int>` | :ref:`anti_aliasing_size<class_StyleBoxFlat_property_anti_aliasing_size>` |
  18. +---------------------------+-------------------------------------------------------------------------------------------+
  19. | :ref:`Color<class_Color>` | :ref:`bg_color<class_StyleBoxFlat_property_bg_color>` |
  20. +---------------------------+-------------------------------------------------------------------------------------------+
  21. | :ref:`bool<class_bool>` | :ref:`border_blend<class_StyleBoxFlat_property_border_blend>` |
  22. +---------------------------+-------------------------------------------------------------------------------------------+
  23. | :ref:`Color<class_Color>` | :ref:`border_color<class_StyleBoxFlat_property_border_color>` |
  24. +---------------------------+-------------------------------------------------------------------------------------------+
  25. | :ref:`int<class_int>` | :ref:`border_width_bottom<class_StyleBoxFlat_property_border_width_bottom>` |
  26. +---------------------------+-------------------------------------------------------------------------------------------+
  27. | :ref:`int<class_int>` | :ref:`border_width_left<class_StyleBoxFlat_property_border_width_left>` |
  28. +---------------------------+-------------------------------------------------------------------------------------------+
  29. | :ref:`int<class_int>` | :ref:`border_width_right<class_StyleBoxFlat_property_border_width_right>` |
  30. +---------------------------+-------------------------------------------------------------------------------------------+
  31. | :ref:`int<class_int>` | :ref:`border_width_top<class_StyleBoxFlat_property_border_width_top>` |
  32. +---------------------------+-------------------------------------------------------------------------------------------+
  33. | :ref:`int<class_int>` | :ref:`corner_detail<class_StyleBoxFlat_property_corner_detail>` |
  34. +---------------------------+-------------------------------------------------------------------------------------------+
  35. | :ref:`int<class_int>` | :ref:`corner_radius_bottom_left<class_StyleBoxFlat_property_corner_radius_bottom_left>` |
  36. +---------------------------+-------------------------------------------------------------------------------------------+
  37. | :ref:`int<class_int>` | :ref:`corner_radius_bottom_right<class_StyleBoxFlat_property_corner_radius_bottom_right>` |
  38. +---------------------------+-------------------------------------------------------------------------------------------+
  39. | :ref:`int<class_int>` | :ref:`corner_radius_top_left<class_StyleBoxFlat_property_corner_radius_top_left>` |
  40. +---------------------------+-------------------------------------------------------------------------------------------+
  41. | :ref:`int<class_int>` | :ref:`corner_radius_top_right<class_StyleBoxFlat_property_corner_radius_top_right>` |
  42. +---------------------------+-------------------------------------------------------------------------------------------+
  43. | :ref:`bool<class_bool>` | :ref:`draw_center<class_StyleBoxFlat_property_draw_center>` |
  44. +---------------------------+-------------------------------------------------------------------------------------------+
  45. | :ref:`float<class_float>` | :ref:`expand_margin_bottom<class_StyleBoxFlat_property_expand_margin_bottom>` |
  46. +---------------------------+-------------------------------------------------------------------------------------------+
  47. | :ref:`float<class_float>` | :ref:`expand_margin_left<class_StyleBoxFlat_property_expand_margin_left>` |
  48. +---------------------------+-------------------------------------------------------------------------------------------+
  49. | :ref:`float<class_float>` | :ref:`expand_margin_right<class_StyleBoxFlat_property_expand_margin_right>` |
  50. +---------------------------+-------------------------------------------------------------------------------------------+
  51. | :ref:`float<class_float>` | :ref:`expand_margin_top<class_StyleBoxFlat_property_expand_margin_top>` |
  52. +---------------------------+-------------------------------------------------------------------------------------------+
  53. | :ref:`Color<class_Color>` | :ref:`shadow_color<class_StyleBoxFlat_property_shadow_color>` |
  54. +---------------------------+-------------------------------------------------------------------------------------------+
  55. | :ref:`int<class_int>` | :ref:`shadow_size<class_StyleBoxFlat_property_shadow_size>` |
  56. +---------------------------+-------------------------------------------------------------------------------------------+
  57. Methods
  58. -------
  59. +-----------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  60. | :ref:`int<class_int>` | :ref:`get_border_width_min<class_StyleBoxFlat_method_get_border_width_min>` **(** **)** const |
  61. +-----------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  62. | void | :ref:`set_border_width_all<class_StyleBoxFlat_method_set_border_width_all>` **(** :ref:`int<class_int>` width **)** |
  63. +-----------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  64. | void | :ref:`set_corner_radius_all<class_StyleBoxFlat_method_set_corner_radius_all>` **(** :ref:`int<class_int>` radius **)** |
  65. +-----------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  66. | void | :ref:`set_corner_radius_individual<class_StyleBoxFlat_method_set_corner_radius_individual>` **(** :ref:`int<class_int>` radius_top_left, :ref:`int<class_int>` radius_top_right, :ref:`int<class_int>` radius_bottom_right, :ref:`int<class_int>` radius_bottom_left **)** |
  67. +-----------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  68. | void | :ref:`set_expand_margin_all<class_StyleBoxFlat_method_set_expand_margin_all>` **(** :ref:`float<class_float>` size **)** |
  69. +-----------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  70. | void | :ref:`set_expand_margin_individual<class_StyleBoxFlat_method_set_expand_margin_individual>` **(** :ref:`float<class_float>` size_left, :ref:`float<class_float>` size_top, :ref:`float<class_float>` size_right, :ref:`float<class_float>` size_bottom **)** |
  71. +-----------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  72. Description
  73. -----------
  74. This stylebox can be used to achieve all kinds of looks without the need of a texture. Those properties are customizable:
  75. - Color
  76. - Border width (individual width for each border)
  77. - Rounded corners (individual radius for each corner)
  78. - Shadow
  79. Setting corner radius to high values is allowed. As soon as corners would overlap the stylebox will switch to a relative system. Example:
  80. ::
  81. height = 30
  82. corner_radius_top_left = 50
  83. corner_radius_bottom_left = 100
  84. The relative system now would take the 1:2 ratio of the two left corners to calculate the actual corner width. Both corners added will **never** be more than the height. Result:
  85. ::
  86. corner_radius_top_left: 10
  87. corner_radius_bottom_left: 20
  88. Property Descriptions
  89. ---------------------
  90. .. _class_StyleBoxFlat_property_anti_aliasing:
  91. - :ref:`bool<class_bool>` **anti_aliasing**
  92. +----------+-------------------------+
  93. | *Setter* | set_anti_aliased(value) |
  94. +----------+-------------------------+
  95. | *Getter* | is_anti_aliased() |
  96. +----------+-------------------------+
  97. Anti Aliasing draws a small ring around edges. This ring fades to transparent. As a result edges look much smoother. This is only noticeable when using rounded corners.
  98. .. _class_StyleBoxFlat_property_anti_aliasing_size:
  99. - :ref:`int<class_int>` **anti_aliasing_size**
  100. +----------+--------------------+
  101. | *Setter* | set_aa_size(value) |
  102. +----------+--------------------+
  103. | *Getter* | get_aa_size() |
  104. +----------+--------------------+
  105. This changes the size of the faded ring. Higher values can be used to achieve a "blurry" effect.
  106. .. _class_StyleBoxFlat_property_bg_color:
  107. - :ref:`Color<class_Color>` **bg_color**
  108. +----------+---------------------+
  109. | *Setter* | set_bg_color(value) |
  110. +----------+---------------------+
  111. | *Getter* | get_bg_color() |
  112. +----------+---------------------+
  113. The background color of the stylebox.
  114. .. _class_StyleBoxFlat_property_border_blend:
  115. - :ref:`bool<class_bool>` **border_blend**
  116. +----------+-------------------------+
  117. | *Setter* | set_border_blend(value) |
  118. +----------+-------------------------+
  119. | *Getter* | get_border_blend() |
  120. +----------+-------------------------+
  121. When set to true, the border will fade into the background color.
  122. .. _class_StyleBoxFlat_property_border_color:
  123. - :ref:`Color<class_Color>` **border_color**
  124. +----------+-------------------------+
  125. | *Setter* | set_border_color(value) |
  126. +----------+-------------------------+
  127. | *Getter* | get_border_color() |
  128. +----------+-------------------------+
  129. Sets the color of the border.
  130. .. _class_StyleBoxFlat_property_border_width_bottom:
  131. - :ref:`int<class_int>` **border_width_bottom**
  132. +----------+-------------------------+
  133. | *Setter* | set_border_width(value) |
  134. +----------+-------------------------+
  135. | *Getter* | get_border_width() |
  136. +----------+-------------------------+
  137. Border width for the bottom border.
  138. .. _class_StyleBoxFlat_property_border_width_left:
  139. - :ref:`int<class_int>` **border_width_left**
  140. +----------+-------------------------+
  141. | *Setter* | set_border_width(value) |
  142. +----------+-------------------------+
  143. | *Getter* | get_border_width() |
  144. +----------+-------------------------+
  145. Border width for the left border.
  146. .. _class_StyleBoxFlat_property_border_width_right:
  147. - :ref:`int<class_int>` **border_width_right**
  148. +----------+-------------------------+
  149. | *Setter* | set_border_width(value) |
  150. +----------+-------------------------+
  151. | *Getter* | get_border_width() |
  152. +----------+-------------------------+
  153. Border width for the right border.
  154. .. _class_StyleBoxFlat_property_border_width_top:
  155. - :ref:`int<class_int>` **border_width_top**
  156. +----------+-------------------------+
  157. | *Setter* | set_border_width(value) |
  158. +----------+-------------------------+
  159. | *Getter* | get_border_width() |
  160. +----------+-------------------------+
  161. Border width for the top border.
  162. .. _class_StyleBoxFlat_property_corner_detail:
  163. - :ref:`int<class_int>` **corner_detail**
  164. +----------+--------------------------+
  165. | *Setter* | set_corner_detail(value) |
  166. +----------+--------------------------+
  167. | *Getter* | get_corner_detail() |
  168. +----------+--------------------------+
  169. This sets the amount of vertices used for each corner. Higher values result in rounder corners but take more processing power to compute. When choosing a value you should take the corner radius (:ref:`set_corner_radius_all<class_StyleBoxFlat_method_set_corner_radius_all>`) into account.
  170. For corner radius smaller than 10, 4-5 should be enough.
  171. For corner radius smaller than 30, 8-12 should be enough.
  172. .. _class_StyleBoxFlat_property_corner_radius_bottom_left:
  173. - :ref:`int<class_int>` **corner_radius_bottom_left**
  174. +----------+--------------------------+
  175. | *Setter* | set_corner_radius(value) |
  176. +----------+--------------------------+
  177. | *Getter* | get_corner_radius() |
  178. +----------+--------------------------+
  179. The corner radius of the bottom left corner. When set to 0 the corner is not rounded.
  180. .. _class_StyleBoxFlat_property_corner_radius_bottom_right:
  181. - :ref:`int<class_int>` **corner_radius_bottom_right**
  182. +----------+--------------------------+
  183. | *Setter* | set_corner_radius(value) |
  184. +----------+--------------------------+
  185. | *Getter* | get_corner_radius() |
  186. +----------+--------------------------+
  187. The corner radius of the bottom right corner. When set to 0 the corner is not rounded.
  188. .. _class_StyleBoxFlat_property_corner_radius_top_left:
  189. - :ref:`int<class_int>` **corner_radius_top_left**
  190. +----------+--------------------------+
  191. | *Setter* | set_corner_radius(value) |
  192. +----------+--------------------------+
  193. | *Getter* | get_corner_radius() |
  194. +----------+--------------------------+
  195. The corner radius of the top left corner. When set to 0 the corner is not rounded.
  196. .. _class_StyleBoxFlat_property_corner_radius_top_right:
  197. - :ref:`int<class_int>` **corner_radius_top_right**
  198. +----------+--------------------------+
  199. | *Setter* | set_corner_radius(value) |
  200. +----------+--------------------------+
  201. | *Getter* | get_corner_radius() |
  202. +----------+--------------------------+
  203. The corner radius of the top right corner. When set to 0 the corner is not rounded.
  204. .. _class_StyleBoxFlat_property_draw_center:
  205. - :ref:`bool<class_bool>` **draw_center**
  206. +----------+--------------------------+
  207. | *Setter* | set_draw_center(value) |
  208. +----------+--------------------------+
  209. | *Getter* | is_draw_center_enabled() |
  210. +----------+--------------------------+
  211. Toggels drawing of the inner part of the stylebox.
  212. .. _class_StyleBoxFlat_property_expand_margin_bottom:
  213. - :ref:`float<class_float>` **expand_margin_bottom**
  214. +----------+--------------------------+
  215. | *Setter* | set_expand_margin(value) |
  216. +----------+--------------------------+
  217. | *Getter* | get_expand_margin() |
  218. +----------+--------------------------+
  219. Expands the stylebox outside of the control rect on the bottom edge. Useful in combination with border_width_bottom. To draw a border outside the control rect.
  220. .. _class_StyleBoxFlat_property_expand_margin_left:
  221. - :ref:`float<class_float>` **expand_margin_left**
  222. +----------+--------------------------+
  223. | *Setter* | set_expand_margin(value) |
  224. +----------+--------------------------+
  225. | *Getter* | get_expand_margin() |
  226. +----------+--------------------------+
  227. Expands the stylebox outside of the control rect on the left edge. Useful in combination with border_width_left. To draw a border outside the control rect.
  228. .. _class_StyleBoxFlat_property_expand_margin_right:
  229. - :ref:`float<class_float>` **expand_margin_right**
  230. +----------+--------------------------+
  231. | *Setter* | set_expand_margin(value) |
  232. +----------+--------------------------+
  233. | *Getter* | get_expand_margin() |
  234. +----------+--------------------------+
  235. Expands the stylebox outside of the control rect on the right edge. Useful in combination with border_width_right. To draw a border outside the control rect.
  236. .. _class_StyleBoxFlat_property_expand_margin_top:
  237. - :ref:`float<class_float>` **expand_margin_top**
  238. +----------+--------------------------+
  239. | *Setter* | set_expand_margin(value) |
  240. +----------+--------------------------+
  241. | *Getter* | get_expand_margin() |
  242. +----------+--------------------------+
  243. Expands the stylebox outside of the control rect on the top edge. Useful in combination with border_width_top. To draw a border outside the control rect.
  244. .. _class_StyleBoxFlat_property_shadow_color:
  245. - :ref:`Color<class_Color>` **shadow_color**
  246. +----------+-------------------------+
  247. | *Setter* | set_shadow_color(value) |
  248. +----------+-------------------------+
  249. | *Getter* | get_shadow_color() |
  250. +----------+-------------------------+
  251. The color of the shadow. (This has no effect when shadow_size < 1)
  252. .. _class_StyleBoxFlat_property_shadow_size:
  253. - :ref:`int<class_int>` **shadow_size**
  254. +----------+------------------------+
  255. | *Setter* | set_shadow_size(value) |
  256. +----------+------------------------+
  257. | *Getter* | get_shadow_size() |
  258. +----------+------------------------+
  259. The shadow size in pixels.
  260. Method Descriptions
  261. -------------------
  262. .. _class_StyleBoxFlat_method_get_border_width_min:
  263. - :ref:`int<class_int>` **get_border_width_min** **(** **)** const
  264. .. _class_StyleBoxFlat_method_set_border_width_all:
  265. - void **set_border_width_all** **(** :ref:`int<class_int>` width **)**
  266. .. _class_StyleBoxFlat_method_set_corner_radius_all:
  267. - void **set_corner_radius_all** **(** :ref:`int<class_int>` radius **)**
  268. .. _class_StyleBoxFlat_method_set_corner_radius_individual:
  269. - void **set_corner_radius_individual** **(** :ref:`int<class_int>` radius_top_left, :ref:`int<class_int>` radius_top_right, :ref:`int<class_int>` radius_bottom_right, :ref:`int<class_int>` radius_bottom_left **)**
  270. .. _class_StyleBoxFlat_method_set_expand_margin_all:
  271. - void **set_expand_margin_all** **(** :ref:`float<class_float>` size **)**
  272. .. _class_StyleBoxFlat_method_set_expand_margin_individual:
  273. - void **set_expand_margin_individual** **(** :ref:`float<class_float>` size_left, :ref:`float<class_float>` size_top, :ref:`float<class_float>` size_right, :ref:`float<class_float>` size_bottom **)**