class_styleboxflat.rst 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/StyleBoxFlat.xml.
  6. .. _class_StyleBoxFlat:
  7. StyleBoxFlat
  8. ============
  9. **Inherits:** :ref:`StyleBox<class_StyleBox>` **<** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. A customizable :ref:`StyleBox<class_StyleBox>` that doesn't use a texture.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. By configuring various properties of this style box, you can achieve many common looks without the need of a texture. This includes optionally rounded borders, antialiasing, shadows, and skew.
  15. Setting corner radius to high values is allowed. As soon as corners overlap, the stylebox will switch to a relative system:
  16. .. code:: text
  17. height = 30
  18. corner_radius_top_left = 50
  19. corner_radius_bottom_left = 100
  20. 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:
  21. .. code:: text
  22. corner_radius_top_left: 10
  23. corner_radius_bottom_left: 20
  24. .. rst-class:: classref-reftable-group
  25. Properties
  26. ----------
  27. .. table::
  28. :widths: auto
  29. +-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  30. | :ref:`bool<class_bool>` | :ref:`anti_aliasing<class_StyleBoxFlat_property_anti_aliasing>` | ``true`` |
  31. +-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  32. | :ref:`float<class_float>` | :ref:`anti_aliasing_size<class_StyleBoxFlat_property_anti_aliasing_size>` | ``1.0`` |
  33. +-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  34. | :ref:`Color<class_Color>` | :ref:`bg_color<class_StyleBoxFlat_property_bg_color>` | ``Color(0.6, 0.6, 0.6, 1)`` |
  35. +-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  36. | :ref:`bool<class_bool>` | :ref:`border_blend<class_StyleBoxFlat_property_border_blend>` | ``false`` |
  37. +-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  38. | :ref:`Color<class_Color>` | :ref:`border_color<class_StyleBoxFlat_property_border_color>` | ``Color(0.8, 0.8, 0.8, 1)`` |
  39. +-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  40. | :ref:`int<class_int>` | :ref:`border_width_bottom<class_StyleBoxFlat_property_border_width_bottom>` | ``0`` |
  41. +-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  42. | :ref:`int<class_int>` | :ref:`border_width_left<class_StyleBoxFlat_property_border_width_left>` | ``0`` |
  43. +-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  44. | :ref:`int<class_int>` | :ref:`border_width_right<class_StyleBoxFlat_property_border_width_right>` | ``0`` |
  45. +-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  46. | :ref:`int<class_int>` | :ref:`border_width_top<class_StyleBoxFlat_property_border_width_top>` | ``0`` |
  47. +-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  48. | :ref:`int<class_int>` | :ref:`corner_detail<class_StyleBoxFlat_property_corner_detail>` | ``8`` |
  49. +-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  50. | :ref:`int<class_int>` | :ref:`corner_radius_bottom_left<class_StyleBoxFlat_property_corner_radius_bottom_left>` | ``0`` |
  51. +-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  52. | :ref:`int<class_int>` | :ref:`corner_radius_bottom_right<class_StyleBoxFlat_property_corner_radius_bottom_right>` | ``0`` |
  53. +-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  54. | :ref:`int<class_int>` | :ref:`corner_radius_top_left<class_StyleBoxFlat_property_corner_radius_top_left>` | ``0`` |
  55. +-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  56. | :ref:`int<class_int>` | :ref:`corner_radius_top_right<class_StyleBoxFlat_property_corner_radius_top_right>` | ``0`` |
  57. +-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  58. | :ref:`bool<class_bool>` | :ref:`draw_center<class_StyleBoxFlat_property_draw_center>` | ``true`` |
  59. +-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  60. | :ref:`float<class_float>` | :ref:`expand_margin_bottom<class_StyleBoxFlat_property_expand_margin_bottom>` | ``0.0`` |
  61. +-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  62. | :ref:`float<class_float>` | :ref:`expand_margin_left<class_StyleBoxFlat_property_expand_margin_left>` | ``0.0`` |
  63. +-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  64. | :ref:`float<class_float>` | :ref:`expand_margin_right<class_StyleBoxFlat_property_expand_margin_right>` | ``0.0`` |
  65. +-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  66. | :ref:`float<class_float>` | :ref:`expand_margin_top<class_StyleBoxFlat_property_expand_margin_top>` | ``0.0`` |
  67. +-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  68. | :ref:`Color<class_Color>` | :ref:`shadow_color<class_StyleBoxFlat_property_shadow_color>` | ``Color(0, 0, 0, 0.6)`` |
  69. +-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  70. | :ref:`Vector2<class_Vector2>` | :ref:`shadow_offset<class_StyleBoxFlat_property_shadow_offset>` | ``Vector2(0, 0)`` |
  71. +-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  72. | :ref:`int<class_int>` | :ref:`shadow_size<class_StyleBoxFlat_property_shadow_size>` | ``0`` |
  73. +-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  74. | :ref:`Vector2<class_Vector2>` | :ref:`skew<class_StyleBoxFlat_property_skew>` | ``Vector2(0, 0)`` |
  75. +-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  76. .. rst-class:: classref-reftable-group
  77. Methods
  78. -------
  79. .. table::
  80. :widths: auto
  81. +---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
  82. | :ref:`int<class_int>` | :ref:`get_border_width<class_StyleBoxFlat_method_get_border_width>`\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const| |
  83. +---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
  84. | :ref:`int<class_int>` | :ref:`get_border_width_min<class_StyleBoxFlat_method_get_border_width_min>`\ (\ ) |const| |
  85. +---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
  86. | :ref:`int<class_int>` | :ref:`get_corner_radius<class_StyleBoxFlat_method_get_corner_radius>`\ (\ corner\: :ref:`Corner<enum_@GlobalScope_Corner>`\ ) |const| |
  87. +---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
  88. | :ref:`float<class_float>` | :ref:`get_expand_margin<class_StyleBoxFlat_method_get_expand_margin>`\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const| |
  89. +---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
  90. | |void| | :ref:`set_border_width<class_StyleBoxFlat_method_set_border_width>`\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`, width\: :ref:`int<class_int>`\ ) |
  91. +---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
  92. | |void| | :ref:`set_border_width_all<class_StyleBoxFlat_method_set_border_width_all>`\ (\ width\: :ref:`int<class_int>`\ ) |
  93. +---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
  94. | |void| | :ref:`set_corner_radius<class_StyleBoxFlat_method_set_corner_radius>`\ (\ corner\: :ref:`Corner<enum_@GlobalScope_Corner>`, radius\: :ref:`int<class_int>`\ ) |
  95. +---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
  96. | |void| | :ref:`set_corner_radius_all<class_StyleBoxFlat_method_set_corner_radius_all>`\ (\ radius\: :ref:`int<class_int>`\ ) |
  97. +---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
  98. | |void| | :ref:`set_expand_margin<class_StyleBoxFlat_method_set_expand_margin>`\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`, size\: :ref:`float<class_float>`\ ) |
  99. +---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
  100. | |void| | :ref:`set_expand_margin_all<class_StyleBoxFlat_method_set_expand_margin_all>`\ (\ size\: :ref:`float<class_float>`\ ) |
  101. +---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
  102. .. rst-class:: classref-section-separator
  103. ----
  104. .. rst-class:: classref-descriptions-group
  105. Property Descriptions
  106. ---------------------
  107. .. _class_StyleBoxFlat_property_anti_aliasing:
  108. .. rst-class:: classref-property
  109. :ref:`bool<class_bool>` **anti_aliasing** = ``true`` :ref:`🔗<class_StyleBoxFlat_property_anti_aliasing>`
  110. .. rst-class:: classref-property-setget
  111. - |void| **set_anti_aliased**\ (\ value\: :ref:`bool<class_bool>`\ )
  112. - :ref:`bool<class_bool>` **is_anti_aliased**\ (\ )
  113. Antialiasing draws a small ring around the edges, which fades to transparency. As a result, edges look much smoother. This is only noticeable when using rounded corners or :ref:`skew<class_StyleBoxFlat_property_skew>`.
  114. \ **Note:** When using beveled corners with 45-degree angles (:ref:`corner_detail<class_StyleBoxFlat_property_corner_detail>` = 1), it is recommended to set :ref:`anti_aliasing<class_StyleBoxFlat_property_anti_aliasing>` to ``false`` to ensure crisp visuals and avoid possible visual glitches.
  115. .. rst-class:: classref-item-separator
  116. ----
  117. .. _class_StyleBoxFlat_property_anti_aliasing_size:
  118. .. rst-class:: classref-property
  119. :ref:`float<class_float>` **anti_aliasing_size** = ``1.0`` :ref:`🔗<class_StyleBoxFlat_property_anti_aliasing_size>`
  120. .. rst-class:: classref-property-setget
  121. - |void| **set_aa_size**\ (\ value\: :ref:`float<class_float>`\ )
  122. - :ref:`float<class_float>` **get_aa_size**\ (\ )
  123. This changes the size of the antialiasing effect. ``1.0`` is recommended for an optimal result at 100% scale, identical to how rounded rectangles are rendered in web browsers and most vector drawing software.
  124. \ **Note:** Higher values may produce a blur effect but can also create undesired artifacts on small boxes with large-radius corners.
  125. .. rst-class:: classref-item-separator
  126. ----
  127. .. _class_StyleBoxFlat_property_bg_color:
  128. .. rst-class:: classref-property
  129. :ref:`Color<class_Color>` **bg_color** = ``Color(0.6, 0.6, 0.6, 1)`` :ref:`🔗<class_StyleBoxFlat_property_bg_color>`
  130. .. rst-class:: classref-property-setget
  131. - |void| **set_bg_color**\ (\ value\: :ref:`Color<class_Color>`\ )
  132. - :ref:`Color<class_Color>` **get_bg_color**\ (\ )
  133. The background color of the stylebox.
  134. .. rst-class:: classref-item-separator
  135. ----
  136. .. _class_StyleBoxFlat_property_border_blend:
  137. .. rst-class:: classref-property
  138. :ref:`bool<class_bool>` **border_blend** = ``false`` :ref:`🔗<class_StyleBoxFlat_property_border_blend>`
  139. .. rst-class:: classref-property-setget
  140. - |void| **set_border_blend**\ (\ value\: :ref:`bool<class_bool>`\ )
  141. - :ref:`bool<class_bool>` **get_border_blend**\ (\ )
  142. If ``true``, the border will fade into the background color.
  143. .. rst-class:: classref-item-separator
  144. ----
  145. .. _class_StyleBoxFlat_property_border_color:
  146. .. rst-class:: classref-property
  147. :ref:`Color<class_Color>` **border_color** = ``Color(0.8, 0.8, 0.8, 1)`` :ref:`🔗<class_StyleBoxFlat_property_border_color>`
  148. .. rst-class:: classref-property-setget
  149. - |void| **set_border_color**\ (\ value\: :ref:`Color<class_Color>`\ )
  150. - :ref:`Color<class_Color>` **get_border_color**\ (\ )
  151. Sets the color of the border.
  152. .. rst-class:: classref-item-separator
  153. ----
  154. .. _class_StyleBoxFlat_property_border_width_bottom:
  155. .. rst-class:: classref-property
  156. :ref:`int<class_int>` **border_width_bottom** = ``0`` :ref:`🔗<class_StyleBoxFlat_property_border_width_bottom>`
  157. .. rst-class:: classref-property-setget
  158. - |void| **set_border_width**\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`, width\: :ref:`int<class_int>`\ )
  159. - :ref:`int<class_int>` **get_border_width**\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const|
  160. Border width for the bottom border.
  161. .. rst-class:: classref-item-separator
  162. ----
  163. .. _class_StyleBoxFlat_property_border_width_left:
  164. .. rst-class:: classref-property
  165. :ref:`int<class_int>` **border_width_left** = ``0`` :ref:`🔗<class_StyleBoxFlat_property_border_width_left>`
  166. .. rst-class:: classref-property-setget
  167. - |void| **set_border_width**\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`, width\: :ref:`int<class_int>`\ )
  168. - :ref:`int<class_int>` **get_border_width**\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const|
  169. Border width for the left border.
  170. .. rst-class:: classref-item-separator
  171. ----
  172. .. _class_StyleBoxFlat_property_border_width_right:
  173. .. rst-class:: classref-property
  174. :ref:`int<class_int>` **border_width_right** = ``0`` :ref:`🔗<class_StyleBoxFlat_property_border_width_right>`
  175. .. rst-class:: classref-property-setget
  176. - |void| **set_border_width**\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`, width\: :ref:`int<class_int>`\ )
  177. - :ref:`int<class_int>` **get_border_width**\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const|
  178. Border width for the right border.
  179. .. rst-class:: classref-item-separator
  180. ----
  181. .. _class_StyleBoxFlat_property_border_width_top:
  182. .. rst-class:: classref-property
  183. :ref:`int<class_int>` **border_width_top** = ``0`` :ref:`🔗<class_StyleBoxFlat_property_border_width_top>`
  184. .. rst-class:: classref-property-setget
  185. - |void| **set_border_width**\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`, width\: :ref:`int<class_int>`\ )
  186. - :ref:`int<class_int>` **get_border_width**\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const|
  187. Border width for the top border.
  188. .. rst-class:: classref-item-separator
  189. ----
  190. .. _class_StyleBoxFlat_property_corner_detail:
  191. .. rst-class:: classref-property
  192. :ref:`int<class_int>` **corner_detail** = ``8`` :ref:`🔗<class_StyleBoxFlat_property_corner_detail>`
  193. .. rst-class:: classref-property-setget
  194. - |void| **set_corner_detail**\ (\ value\: :ref:`int<class_int>`\ )
  195. - :ref:`int<class_int>` **get_corner_detail**\ (\ )
  196. This sets the number 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.
  197. For corner radii less than 10, ``4`` or ``5`` should be enough. For corner radii less than 30, values between ``8`` and ``12`` should be enough.
  198. A corner detail of ``1`` will result in chamfered corners instead of rounded corners, which is useful for some artistic effects.
  199. .. rst-class:: classref-item-separator
  200. ----
  201. .. _class_StyleBoxFlat_property_corner_radius_bottom_left:
  202. .. rst-class:: classref-property
  203. :ref:`int<class_int>` **corner_radius_bottom_left** = ``0`` :ref:`🔗<class_StyleBoxFlat_property_corner_radius_bottom_left>`
  204. .. rst-class:: classref-property-setget
  205. - |void| **set_corner_radius**\ (\ corner\: :ref:`Corner<enum_@GlobalScope_Corner>`, radius\: :ref:`int<class_int>`\ )
  206. - :ref:`int<class_int>` **get_corner_radius**\ (\ corner\: :ref:`Corner<enum_@GlobalScope_Corner>`\ ) |const|
  207. The bottom-left corner's radius. If ``0``, the corner is not rounded.
  208. .. rst-class:: classref-item-separator
  209. ----
  210. .. _class_StyleBoxFlat_property_corner_radius_bottom_right:
  211. .. rst-class:: classref-property
  212. :ref:`int<class_int>` **corner_radius_bottom_right** = ``0`` :ref:`🔗<class_StyleBoxFlat_property_corner_radius_bottom_right>`
  213. .. rst-class:: classref-property-setget
  214. - |void| **set_corner_radius**\ (\ corner\: :ref:`Corner<enum_@GlobalScope_Corner>`, radius\: :ref:`int<class_int>`\ )
  215. - :ref:`int<class_int>` **get_corner_radius**\ (\ corner\: :ref:`Corner<enum_@GlobalScope_Corner>`\ ) |const|
  216. The bottom-right corner's radius. If ``0``, the corner is not rounded.
  217. .. rst-class:: classref-item-separator
  218. ----
  219. .. _class_StyleBoxFlat_property_corner_radius_top_left:
  220. .. rst-class:: classref-property
  221. :ref:`int<class_int>` **corner_radius_top_left** = ``0`` :ref:`🔗<class_StyleBoxFlat_property_corner_radius_top_left>`
  222. .. rst-class:: classref-property-setget
  223. - |void| **set_corner_radius**\ (\ corner\: :ref:`Corner<enum_@GlobalScope_Corner>`, radius\: :ref:`int<class_int>`\ )
  224. - :ref:`int<class_int>` **get_corner_radius**\ (\ corner\: :ref:`Corner<enum_@GlobalScope_Corner>`\ ) |const|
  225. The top-left corner's radius. If ``0``, the corner is not rounded.
  226. .. rst-class:: classref-item-separator
  227. ----
  228. .. _class_StyleBoxFlat_property_corner_radius_top_right:
  229. .. rst-class:: classref-property
  230. :ref:`int<class_int>` **corner_radius_top_right** = ``0`` :ref:`🔗<class_StyleBoxFlat_property_corner_radius_top_right>`
  231. .. rst-class:: classref-property-setget
  232. - |void| **set_corner_radius**\ (\ corner\: :ref:`Corner<enum_@GlobalScope_Corner>`, radius\: :ref:`int<class_int>`\ )
  233. - :ref:`int<class_int>` **get_corner_radius**\ (\ corner\: :ref:`Corner<enum_@GlobalScope_Corner>`\ ) |const|
  234. The top-right corner's radius. If ``0``, the corner is not rounded.
  235. .. rst-class:: classref-item-separator
  236. ----
  237. .. _class_StyleBoxFlat_property_draw_center:
  238. .. rst-class:: classref-property
  239. :ref:`bool<class_bool>` **draw_center** = ``true`` :ref:`🔗<class_StyleBoxFlat_property_draw_center>`
  240. .. rst-class:: classref-property-setget
  241. - |void| **set_draw_center**\ (\ value\: :ref:`bool<class_bool>`\ )
  242. - :ref:`bool<class_bool>` **is_draw_center_enabled**\ (\ )
  243. Toggles drawing of the inner part of the stylebox.
  244. .. rst-class:: classref-item-separator
  245. ----
  246. .. _class_StyleBoxFlat_property_expand_margin_bottom:
  247. .. rst-class:: classref-property
  248. :ref:`float<class_float>` **expand_margin_bottom** = ``0.0`` :ref:`🔗<class_StyleBoxFlat_property_expand_margin_bottom>`
  249. .. rst-class:: classref-property-setget
  250. - |void| **set_expand_margin**\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`, size\: :ref:`float<class_float>`\ )
  251. - :ref:`float<class_float>` **get_expand_margin**\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const|
  252. Expands the stylebox outside of the control rect on the bottom edge. Useful in combination with :ref:`border_width_bottom<class_StyleBoxFlat_property_border_width_bottom>` to draw a border outside the control rect.
  253. \ **Note:** Unlike :ref:`StyleBox.content_margin_bottom<class_StyleBox_property_content_margin_bottom>`, :ref:`expand_margin_bottom<class_StyleBoxFlat_property_expand_margin_bottom>` does *not* affect the size of the clickable area for :ref:`Control<class_Control>`\ s. This can negatively impact usability if used wrong, as the user may try to click an area of the StyleBox that cannot actually receive clicks.
  254. .. rst-class:: classref-item-separator
  255. ----
  256. .. _class_StyleBoxFlat_property_expand_margin_left:
  257. .. rst-class:: classref-property
  258. :ref:`float<class_float>` **expand_margin_left** = ``0.0`` :ref:`🔗<class_StyleBoxFlat_property_expand_margin_left>`
  259. .. rst-class:: classref-property-setget
  260. - |void| **set_expand_margin**\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`, size\: :ref:`float<class_float>`\ )
  261. - :ref:`float<class_float>` **get_expand_margin**\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const|
  262. Expands the stylebox outside of the control rect on the left edge. Useful in combination with :ref:`border_width_left<class_StyleBoxFlat_property_border_width_left>` to draw a border outside the control rect.
  263. \ **Note:** Unlike :ref:`StyleBox.content_margin_left<class_StyleBox_property_content_margin_left>`, :ref:`expand_margin_left<class_StyleBoxFlat_property_expand_margin_left>` does *not* affect the size of the clickable area for :ref:`Control<class_Control>`\ s. This can negatively impact usability if used wrong, as the user may try to click an area of the StyleBox that cannot actually receive clicks.
  264. .. rst-class:: classref-item-separator
  265. ----
  266. .. _class_StyleBoxFlat_property_expand_margin_right:
  267. .. rst-class:: classref-property
  268. :ref:`float<class_float>` **expand_margin_right** = ``0.0`` :ref:`🔗<class_StyleBoxFlat_property_expand_margin_right>`
  269. .. rst-class:: classref-property-setget
  270. - |void| **set_expand_margin**\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`, size\: :ref:`float<class_float>`\ )
  271. - :ref:`float<class_float>` **get_expand_margin**\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const|
  272. Expands the stylebox outside of the control rect on the right edge. Useful in combination with :ref:`border_width_right<class_StyleBoxFlat_property_border_width_right>` to draw a border outside the control rect.
  273. \ **Note:** Unlike :ref:`StyleBox.content_margin_right<class_StyleBox_property_content_margin_right>`, :ref:`expand_margin_right<class_StyleBoxFlat_property_expand_margin_right>` does *not* affect the size of the clickable area for :ref:`Control<class_Control>`\ s. This can negatively impact usability if used wrong, as the user may try to click an area of the StyleBox that cannot actually receive clicks.
  274. .. rst-class:: classref-item-separator
  275. ----
  276. .. _class_StyleBoxFlat_property_expand_margin_top:
  277. .. rst-class:: classref-property
  278. :ref:`float<class_float>` **expand_margin_top** = ``0.0`` :ref:`🔗<class_StyleBoxFlat_property_expand_margin_top>`
  279. .. rst-class:: classref-property-setget
  280. - |void| **set_expand_margin**\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`, size\: :ref:`float<class_float>`\ )
  281. - :ref:`float<class_float>` **get_expand_margin**\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const|
  282. Expands the stylebox outside of the control rect on the top edge. Useful in combination with :ref:`border_width_top<class_StyleBoxFlat_property_border_width_top>` to draw a border outside the control rect.
  283. \ **Note:** Unlike :ref:`StyleBox.content_margin_top<class_StyleBox_property_content_margin_top>`, :ref:`expand_margin_top<class_StyleBoxFlat_property_expand_margin_top>` does *not* affect the size of the clickable area for :ref:`Control<class_Control>`\ s. This can negatively impact usability if used wrong, as the user may try to click an area of the StyleBox that cannot actually receive clicks.
  284. .. rst-class:: classref-item-separator
  285. ----
  286. .. _class_StyleBoxFlat_property_shadow_color:
  287. .. rst-class:: classref-property
  288. :ref:`Color<class_Color>` **shadow_color** = ``Color(0, 0, 0, 0.6)`` :ref:`🔗<class_StyleBoxFlat_property_shadow_color>`
  289. .. rst-class:: classref-property-setget
  290. - |void| **set_shadow_color**\ (\ value\: :ref:`Color<class_Color>`\ )
  291. - :ref:`Color<class_Color>` **get_shadow_color**\ (\ )
  292. The color of the shadow. This has no effect if :ref:`shadow_size<class_StyleBoxFlat_property_shadow_size>` is lower than 1.
  293. .. rst-class:: classref-item-separator
  294. ----
  295. .. _class_StyleBoxFlat_property_shadow_offset:
  296. .. rst-class:: classref-property
  297. :ref:`Vector2<class_Vector2>` **shadow_offset** = ``Vector2(0, 0)`` :ref:`🔗<class_StyleBoxFlat_property_shadow_offset>`
  298. .. rst-class:: classref-property-setget
  299. - |void| **set_shadow_offset**\ (\ value\: :ref:`Vector2<class_Vector2>`\ )
  300. - :ref:`Vector2<class_Vector2>` **get_shadow_offset**\ (\ )
  301. The shadow offset in pixels. Adjusts the position of the shadow relatively to the stylebox.
  302. .. rst-class:: classref-item-separator
  303. ----
  304. .. _class_StyleBoxFlat_property_shadow_size:
  305. .. rst-class:: classref-property
  306. :ref:`int<class_int>` **shadow_size** = ``0`` :ref:`🔗<class_StyleBoxFlat_property_shadow_size>`
  307. .. rst-class:: classref-property-setget
  308. - |void| **set_shadow_size**\ (\ value\: :ref:`int<class_int>`\ )
  309. - :ref:`int<class_int>` **get_shadow_size**\ (\ )
  310. The shadow size in pixels.
  311. .. rst-class:: classref-item-separator
  312. ----
  313. .. _class_StyleBoxFlat_property_skew:
  314. .. rst-class:: classref-property
  315. :ref:`Vector2<class_Vector2>` **skew** = ``Vector2(0, 0)`` :ref:`🔗<class_StyleBoxFlat_property_skew>`
  316. .. rst-class:: classref-property-setget
  317. - |void| **set_skew**\ (\ value\: :ref:`Vector2<class_Vector2>`\ )
  318. - :ref:`Vector2<class_Vector2>` **get_skew**\ (\ )
  319. If set to a non-zero value on either axis, :ref:`skew<class_StyleBoxFlat_property_skew>` distorts the StyleBox horizontally and/or vertically. This can be used for "futuristic"-style UIs. Positive values skew the StyleBox towards the right (X axis) and upwards (Y axis), while negative values skew the StyleBox towards the left (X axis) and downwards (Y axis).
  320. \ **Note:** To ensure text does not touch the StyleBox's edges, consider increasing the :ref:`StyleBox<class_StyleBox>`'s content margin (see :ref:`StyleBox.content_margin_bottom<class_StyleBox_property_content_margin_bottom>`). It is preferable to increase the content margin instead of the expand margin (see :ref:`expand_margin_bottom<class_StyleBoxFlat_property_expand_margin_bottom>`), as increasing the expand margin does not increase the size of the clickable area for :ref:`Control<class_Control>`\ s.
  321. .. rst-class:: classref-section-separator
  322. ----
  323. .. rst-class:: classref-descriptions-group
  324. Method Descriptions
  325. -------------------
  326. .. _class_StyleBoxFlat_method_get_border_width:
  327. .. rst-class:: classref-method
  328. :ref:`int<class_int>` **get_border_width**\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const| :ref:`🔗<class_StyleBoxFlat_method_get_border_width>`
  329. Returns the specified :ref:`Side<enum_@GlobalScope_Side>`'s border width.
  330. .. rst-class:: classref-item-separator
  331. ----
  332. .. _class_StyleBoxFlat_method_get_border_width_min:
  333. .. rst-class:: classref-method
  334. :ref:`int<class_int>` **get_border_width_min**\ (\ ) |const| :ref:`🔗<class_StyleBoxFlat_method_get_border_width_min>`
  335. Returns the smallest border width out of all four borders.
  336. .. rst-class:: classref-item-separator
  337. ----
  338. .. _class_StyleBoxFlat_method_get_corner_radius:
  339. .. rst-class:: classref-method
  340. :ref:`int<class_int>` **get_corner_radius**\ (\ corner\: :ref:`Corner<enum_@GlobalScope_Corner>`\ ) |const| :ref:`🔗<class_StyleBoxFlat_method_get_corner_radius>`
  341. Returns the given ``corner``'s radius. See :ref:`Corner<enum_@GlobalScope_Corner>` for possible values.
  342. .. rst-class:: classref-item-separator
  343. ----
  344. .. _class_StyleBoxFlat_method_get_expand_margin:
  345. .. rst-class:: classref-method
  346. :ref:`float<class_float>` **get_expand_margin**\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const| :ref:`🔗<class_StyleBoxFlat_method_get_expand_margin>`
  347. Returns the size of the specified :ref:`Side<enum_@GlobalScope_Side>`'s expand margin.
  348. .. rst-class:: classref-item-separator
  349. ----
  350. .. _class_StyleBoxFlat_method_set_border_width:
  351. .. rst-class:: classref-method
  352. |void| **set_border_width**\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`, width\: :ref:`int<class_int>`\ ) :ref:`🔗<class_StyleBoxFlat_method_set_border_width>`
  353. Sets the specified :ref:`Side<enum_@GlobalScope_Side>`'s border width to ``width`` pixels.
  354. .. rst-class:: classref-item-separator
  355. ----
  356. .. _class_StyleBoxFlat_method_set_border_width_all:
  357. .. rst-class:: classref-method
  358. |void| **set_border_width_all**\ (\ width\: :ref:`int<class_int>`\ ) :ref:`🔗<class_StyleBoxFlat_method_set_border_width_all>`
  359. Sets the border width to ``width`` pixels for all sides.
  360. .. rst-class:: classref-item-separator
  361. ----
  362. .. _class_StyleBoxFlat_method_set_corner_radius:
  363. .. rst-class:: classref-method
  364. |void| **set_corner_radius**\ (\ corner\: :ref:`Corner<enum_@GlobalScope_Corner>`, radius\: :ref:`int<class_int>`\ ) :ref:`🔗<class_StyleBoxFlat_method_set_corner_radius>`
  365. Sets the corner radius to ``radius`` pixels for the given ``corner``. See :ref:`Corner<enum_@GlobalScope_Corner>` for possible values.
  366. .. rst-class:: classref-item-separator
  367. ----
  368. .. _class_StyleBoxFlat_method_set_corner_radius_all:
  369. .. rst-class:: classref-method
  370. |void| **set_corner_radius_all**\ (\ radius\: :ref:`int<class_int>`\ ) :ref:`🔗<class_StyleBoxFlat_method_set_corner_radius_all>`
  371. Sets the corner radius to ``radius`` pixels for all corners.
  372. .. rst-class:: classref-item-separator
  373. ----
  374. .. _class_StyleBoxFlat_method_set_expand_margin:
  375. .. rst-class:: classref-method
  376. |void| **set_expand_margin**\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`, size\: :ref:`float<class_float>`\ ) :ref:`🔗<class_StyleBoxFlat_method_set_expand_margin>`
  377. Sets the expand margin to ``size`` pixels for the specified :ref:`Side<enum_@GlobalScope_Side>`.
  378. .. rst-class:: classref-item-separator
  379. ----
  380. .. _class_StyleBoxFlat_method_set_expand_margin_all:
  381. .. rst-class:: classref-method
  382. |void| **set_expand_margin_all**\ (\ size\: :ref:`float<class_float>`\ ) :ref:`🔗<class_StyleBoxFlat_method_set_expand_margin_all>`
  383. Sets the expand margin to ``size`` pixels for all sides.
  384. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  385. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  386. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  387. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  388. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  389. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  390. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  391. .. |void| replace:: :abbr:`void (No return value.)`