class_styleboxflat.rst 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673
  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. \ **Example:**\
  17. ::
  18. height = 30
  19. corner_radius_top_left = 50
  20. corner_radius_bottom_left = 100
  21. 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:
  22. ::
  23. corner_radius_top_left: 10
  24. corner_radius_bottom_left: 20
  25. .. rst-class:: classref-reftable-group
  26. Properties
  27. ----------
  28. .. table::
  29. :widths: auto
  30. +-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  31. | :ref:`bool<class_bool>` | :ref:`anti_aliasing<class_StyleBoxFlat_property_anti_aliasing>` | ``true`` |
  32. +-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  33. | :ref:`float<class_float>` | :ref:`anti_aliasing_size<class_StyleBoxFlat_property_anti_aliasing_size>` | ``1.0`` |
  34. +-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  35. | :ref:`Color<class_Color>` | :ref:`bg_color<class_StyleBoxFlat_property_bg_color>` | ``Color(0.6, 0.6, 0.6, 1)`` |
  36. +-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  37. | :ref:`bool<class_bool>` | :ref:`border_blend<class_StyleBoxFlat_property_border_blend>` | ``false`` |
  38. +-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  39. | :ref:`Color<class_Color>` | :ref:`border_color<class_StyleBoxFlat_property_border_color>` | ``Color(0.8, 0.8, 0.8, 1)`` |
  40. +-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  41. | :ref:`int<class_int>` | :ref:`border_width_bottom<class_StyleBoxFlat_property_border_width_bottom>` | ``0`` |
  42. +-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  43. | :ref:`int<class_int>` | :ref:`border_width_left<class_StyleBoxFlat_property_border_width_left>` | ``0`` |
  44. +-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  45. | :ref:`int<class_int>` | :ref:`border_width_right<class_StyleBoxFlat_property_border_width_right>` | ``0`` |
  46. +-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  47. | :ref:`int<class_int>` | :ref:`border_width_top<class_StyleBoxFlat_property_border_width_top>` | ``0`` |
  48. +-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  49. | :ref:`int<class_int>` | :ref:`corner_detail<class_StyleBoxFlat_property_corner_detail>` | ``8`` |
  50. +-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  51. | :ref:`int<class_int>` | :ref:`corner_radius_bottom_left<class_StyleBoxFlat_property_corner_radius_bottom_left>` | ``0`` |
  52. +-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  53. | :ref:`int<class_int>` | :ref:`corner_radius_bottom_right<class_StyleBoxFlat_property_corner_radius_bottom_right>` | ``0`` |
  54. +-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  55. | :ref:`int<class_int>` | :ref:`corner_radius_top_left<class_StyleBoxFlat_property_corner_radius_top_left>` | ``0`` |
  56. +-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  57. | :ref:`int<class_int>` | :ref:`corner_radius_top_right<class_StyleBoxFlat_property_corner_radius_top_right>` | ``0`` |
  58. +-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  59. | :ref:`bool<class_bool>` | :ref:`draw_center<class_StyleBoxFlat_property_draw_center>` | ``true`` |
  60. +-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  61. | :ref:`float<class_float>` | :ref:`expand_margin_bottom<class_StyleBoxFlat_property_expand_margin_bottom>` | ``0.0`` |
  62. +-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  63. | :ref:`float<class_float>` | :ref:`expand_margin_left<class_StyleBoxFlat_property_expand_margin_left>` | ``0.0`` |
  64. +-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  65. | :ref:`float<class_float>` | :ref:`expand_margin_right<class_StyleBoxFlat_property_expand_margin_right>` | ``0.0`` |
  66. +-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  67. | :ref:`float<class_float>` | :ref:`expand_margin_top<class_StyleBoxFlat_property_expand_margin_top>` | ``0.0`` |
  68. +-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  69. | :ref:`Color<class_Color>` | :ref:`shadow_color<class_StyleBoxFlat_property_shadow_color>` | ``Color(0, 0, 0, 0.6)`` |
  70. +-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  71. | :ref:`Vector2<class_Vector2>` | :ref:`shadow_offset<class_StyleBoxFlat_property_shadow_offset>` | ``Vector2(0, 0)`` |
  72. +-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  73. | :ref:`int<class_int>` | :ref:`shadow_size<class_StyleBoxFlat_property_shadow_size>` | ``0`` |
  74. +-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  75. | :ref:`Vector2<class_Vector2>` | :ref:`skew<class_StyleBoxFlat_property_skew>` | ``Vector2(0, 0)`` |
  76. +-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
  77. .. rst-class:: classref-reftable-group
  78. Methods
  79. -------
  80. .. table::
  81. :widths: auto
  82. +---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
  83. | :ref:`int<class_int>` | :ref:`get_border_width<class_StyleBoxFlat_method_get_border_width>` **(** :ref:`Side<enum_@GlobalScope_Side>` margin **)** |const| |
  84. +---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
  85. | :ref:`int<class_int>` | :ref:`get_border_width_min<class_StyleBoxFlat_method_get_border_width_min>` **(** **)** |const| |
  86. +---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
  87. | :ref:`int<class_int>` | :ref:`get_corner_radius<class_StyleBoxFlat_method_get_corner_radius>` **(** :ref:`Corner<enum_@GlobalScope_Corner>` corner **)** |const| |
  88. +---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
  89. | :ref:`float<class_float>` | :ref:`get_expand_margin<class_StyleBoxFlat_method_get_expand_margin>` **(** :ref:`Side<enum_@GlobalScope_Side>` margin **)** |const| |
  90. +---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
  91. | void | :ref:`set_border_width<class_StyleBoxFlat_method_set_border_width>` **(** :ref:`Side<enum_@GlobalScope_Side>` margin, :ref:`int<class_int>` width **)** |
  92. +---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
  93. | void | :ref:`set_border_width_all<class_StyleBoxFlat_method_set_border_width_all>` **(** :ref:`int<class_int>` width **)** |
  94. +---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
  95. | void | :ref:`set_corner_radius<class_StyleBoxFlat_method_set_corner_radius>` **(** :ref:`Corner<enum_@GlobalScope_Corner>` corner, :ref:`int<class_int>` radius **)** |
  96. +---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
  97. | void | :ref:`set_corner_radius_all<class_StyleBoxFlat_method_set_corner_radius_all>` **(** :ref:`int<class_int>` radius **)** |
  98. +---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
  99. | void | :ref:`set_expand_margin<class_StyleBoxFlat_method_set_expand_margin>` **(** :ref:`Side<enum_@GlobalScope_Side>` margin, :ref:`float<class_float>` size **)** |
  100. +---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
  101. | void | :ref:`set_expand_margin_all<class_StyleBoxFlat_method_set_expand_margin_all>` **(** :ref:`float<class_float>` size **)** |
  102. +---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
  103. .. rst-class:: classref-section-separator
  104. ----
  105. .. rst-class:: classref-descriptions-group
  106. Property Descriptions
  107. ---------------------
  108. .. _class_StyleBoxFlat_property_anti_aliasing:
  109. .. rst-class:: classref-property
  110. :ref:`bool<class_bool>` **anti_aliasing** = ``true``
  111. .. rst-class:: classref-property-setget
  112. - void **set_anti_aliased** **(** :ref:`bool<class_bool>` value **)**
  113. - :ref:`bool<class_bool>` **is_anti_aliased** **(** **)**
  114. 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>`.
  115. \ **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.
  116. .. rst-class:: classref-item-separator
  117. ----
  118. .. _class_StyleBoxFlat_property_anti_aliasing_size:
  119. .. rst-class:: classref-property
  120. :ref:`float<class_float>` **anti_aliasing_size** = ``1.0``
  121. .. rst-class:: classref-property-setget
  122. - void **set_aa_size** **(** :ref:`float<class_float>` value **)**
  123. - :ref:`float<class_float>` **get_aa_size** **(** **)**
  124. 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.
  125. \ **Note:** Higher values may produce a blur effect but can also create undesired artifacts on small boxes with large-radius corners.
  126. .. rst-class:: classref-item-separator
  127. ----
  128. .. _class_StyleBoxFlat_property_bg_color:
  129. .. rst-class:: classref-property
  130. :ref:`Color<class_Color>` **bg_color** = ``Color(0.6, 0.6, 0.6, 1)``
  131. .. rst-class:: classref-property-setget
  132. - void **set_bg_color** **(** :ref:`Color<class_Color>` value **)**
  133. - :ref:`Color<class_Color>` **get_bg_color** **(** **)**
  134. The background color of the stylebox.
  135. .. rst-class:: classref-item-separator
  136. ----
  137. .. _class_StyleBoxFlat_property_border_blend:
  138. .. rst-class:: classref-property
  139. :ref:`bool<class_bool>` **border_blend** = ``false``
  140. .. rst-class:: classref-property-setget
  141. - void **set_border_blend** **(** :ref:`bool<class_bool>` value **)**
  142. - :ref:`bool<class_bool>` **get_border_blend** **(** **)**
  143. If ``true``, the border will fade into the background color.
  144. .. rst-class:: classref-item-separator
  145. ----
  146. .. _class_StyleBoxFlat_property_border_color:
  147. .. rst-class:: classref-property
  148. :ref:`Color<class_Color>` **border_color** = ``Color(0.8, 0.8, 0.8, 1)``
  149. .. rst-class:: classref-property-setget
  150. - void **set_border_color** **(** :ref:`Color<class_Color>` value **)**
  151. - :ref:`Color<class_Color>` **get_border_color** **(** **)**
  152. Sets the color of the border.
  153. .. rst-class:: classref-item-separator
  154. ----
  155. .. _class_StyleBoxFlat_property_border_width_bottom:
  156. .. rst-class:: classref-property
  157. :ref:`int<class_int>` **border_width_bottom** = ``0``
  158. .. rst-class:: classref-property-setget
  159. - void **set_border_width** **(** :ref:`Side<enum_@GlobalScope_Side>` margin, :ref:`int<class_int>` width **)**
  160. - :ref:`int<class_int>` **get_border_width** **(** :ref:`Side<enum_@GlobalScope_Side>` margin **)** |const|
  161. Border width for the bottom border.
  162. .. rst-class:: classref-item-separator
  163. ----
  164. .. _class_StyleBoxFlat_property_border_width_left:
  165. .. rst-class:: classref-property
  166. :ref:`int<class_int>` **border_width_left** = ``0``
  167. .. rst-class:: classref-property-setget
  168. - void **set_border_width** **(** :ref:`Side<enum_@GlobalScope_Side>` margin, :ref:`int<class_int>` width **)**
  169. - :ref:`int<class_int>` **get_border_width** **(** :ref:`Side<enum_@GlobalScope_Side>` margin **)** |const|
  170. Border width for the left border.
  171. .. rst-class:: classref-item-separator
  172. ----
  173. .. _class_StyleBoxFlat_property_border_width_right:
  174. .. rst-class:: classref-property
  175. :ref:`int<class_int>` **border_width_right** = ``0``
  176. .. rst-class:: classref-property-setget
  177. - void **set_border_width** **(** :ref:`Side<enum_@GlobalScope_Side>` margin, :ref:`int<class_int>` width **)**
  178. - :ref:`int<class_int>` **get_border_width** **(** :ref:`Side<enum_@GlobalScope_Side>` margin **)** |const|
  179. Border width for the right border.
  180. .. rst-class:: classref-item-separator
  181. ----
  182. .. _class_StyleBoxFlat_property_border_width_top:
  183. .. rst-class:: classref-property
  184. :ref:`int<class_int>` **border_width_top** = ``0``
  185. .. rst-class:: classref-property-setget
  186. - void **set_border_width** **(** :ref:`Side<enum_@GlobalScope_Side>` margin, :ref:`int<class_int>` width **)**
  187. - :ref:`int<class_int>` **get_border_width** **(** :ref:`Side<enum_@GlobalScope_Side>` margin **)** |const|
  188. Border width for the top border.
  189. .. rst-class:: classref-item-separator
  190. ----
  191. .. _class_StyleBoxFlat_property_corner_detail:
  192. .. rst-class:: classref-property
  193. :ref:`int<class_int>` **corner_detail** = ``8``
  194. .. rst-class:: classref-property-setget
  195. - void **set_corner_detail** **(** :ref:`int<class_int>` value **)**
  196. - :ref:`int<class_int>` **get_corner_detail** **(** **)**
  197. 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.
  198. 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.
  199. A corner detail of ``1`` will result in chamfered corners instead of rounded corners, which is useful for some artistic effects.
  200. .. rst-class:: classref-item-separator
  201. ----
  202. .. _class_StyleBoxFlat_property_corner_radius_bottom_left:
  203. .. rst-class:: classref-property
  204. :ref:`int<class_int>` **corner_radius_bottom_left** = ``0``
  205. .. rst-class:: classref-property-setget
  206. - void **set_corner_radius** **(** :ref:`Corner<enum_@GlobalScope_Corner>` corner, :ref:`int<class_int>` radius **)**
  207. - :ref:`int<class_int>` **get_corner_radius** **(** :ref:`Corner<enum_@GlobalScope_Corner>` corner **)** |const|
  208. The bottom-left corner's radius. If ``0``, the corner is not rounded.
  209. .. rst-class:: classref-item-separator
  210. ----
  211. .. _class_StyleBoxFlat_property_corner_radius_bottom_right:
  212. .. rst-class:: classref-property
  213. :ref:`int<class_int>` **corner_radius_bottom_right** = ``0``
  214. .. rst-class:: classref-property-setget
  215. - void **set_corner_radius** **(** :ref:`Corner<enum_@GlobalScope_Corner>` corner, :ref:`int<class_int>` radius **)**
  216. - :ref:`int<class_int>` **get_corner_radius** **(** :ref:`Corner<enum_@GlobalScope_Corner>` corner **)** |const|
  217. The bottom-right corner's radius. If ``0``, the corner is not rounded.
  218. .. rst-class:: classref-item-separator
  219. ----
  220. .. _class_StyleBoxFlat_property_corner_radius_top_left:
  221. .. rst-class:: classref-property
  222. :ref:`int<class_int>` **corner_radius_top_left** = ``0``
  223. .. rst-class:: classref-property-setget
  224. - void **set_corner_radius** **(** :ref:`Corner<enum_@GlobalScope_Corner>` corner, :ref:`int<class_int>` radius **)**
  225. - :ref:`int<class_int>` **get_corner_radius** **(** :ref:`Corner<enum_@GlobalScope_Corner>` corner **)** |const|
  226. The top-left corner's radius. If ``0``, the corner is not rounded.
  227. .. rst-class:: classref-item-separator
  228. ----
  229. .. _class_StyleBoxFlat_property_corner_radius_top_right:
  230. .. rst-class:: classref-property
  231. :ref:`int<class_int>` **corner_radius_top_right** = ``0``
  232. .. rst-class:: classref-property-setget
  233. - void **set_corner_radius** **(** :ref:`Corner<enum_@GlobalScope_Corner>` corner, :ref:`int<class_int>` radius **)**
  234. - :ref:`int<class_int>` **get_corner_radius** **(** :ref:`Corner<enum_@GlobalScope_Corner>` corner **)** |const|
  235. The top-right corner's radius. If ``0``, the corner is not rounded.
  236. .. rst-class:: classref-item-separator
  237. ----
  238. .. _class_StyleBoxFlat_property_draw_center:
  239. .. rst-class:: classref-property
  240. :ref:`bool<class_bool>` **draw_center** = ``true``
  241. .. rst-class:: classref-property-setget
  242. - void **set_draw_center** **(** :ref:`bool<class_bool>` value **)**
  243. - :ref:`bool<class_bool>` **is_draw_center_enabled** **(** **)**
  244. Toggles drawing of the inner part of the stylebox.
  245. .. rst-class:: classref-item-separator
  246. ----
  247. .. _class_StyleBoxFlat_property_expand_margin_bottom:
  248. .. rst-class:: classref-property
  249. :ref:`float<class_float>` **expand_margin_bottom** = ``0.0``
  250. .. rst-class:: classref-property-setget
  251. - void **set_expand_margin** **(** :ref:`Side<enum_@GlobalScope_Side>` margin, :ref:`float<class_float>` size **)**
  252. - :ref:`float<class_float>` **get_expand_margin** **(** :ref:`Side<enum_@GlobalScope_Side>` margin **)** |const|
  253. 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.
  254. \ **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.
  255. .. rst-class:: classref-item-separator
  256. ----
  257. .. _class_StyleBoxFlat_property_expand_margin_left:
  258. .. rst-class:: classref-property
  259. :ref:`float<class_float>` **expand_margin_left** = ``0.0``
  260. .. rst-class:: classref-property-setget
  261. - void **set_expand_margin** **(** :ref:`Side<enum_@GlobalScope_Side>` margin, :ref:`float<class_float>` size **)**
  262. - :ref:`float<class_float>` **get_expand_margin** **(** :ref:`Side<enum_@GlobalScope_Side>` margin **)** |const|
  263. 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.
  264. \ **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.
  265. .. rst-class:: classref-item-separator
  266. ----
  267. .. _class_StyleBoxFlat_property_expand_margin_right:
  268. .. rst-class:: classref-property
  269. :ref:`float<class_float>` **expand_margin_right** = ``0.0``
  270. .. rst-class:: classref-property-setget
  271. - void **set_expand_margin** **(** :ref:`Side<enum_@GlobalScope_Side>` margin, :ref:`float<class_float>` size **)**
  272. - :ref:`float<class_float>` **get_expand_margin** **(** :ref:`Side<enum_@GlobalScope_Side>` margin **)** |const|
  273. 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.
  274. \ **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.
  275. .. rst-class:: classref-item-separator
  276. ----
  277. .. _class_StyleBoxFlat_property_expand_margin_top:
  278. .. rst-class:: classref-property
  279. :ref:`float<class_float>` **expand_margin_top** = ``0.0``
  280. .. rst-class:: classref-property-setget
  281. - void **set_expand_margin** **(** :ref:`Side<enum_@GlobalScope_Side>` margin, :ref:`float<class_float>` size **)**
  282. - :ref:`float<class_float>` **get_expand_margin** **(** :ref:`Side<enum_@GlobalScope_Side>` margin **)** |const|
  283. 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.
  284. \ **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.
  285. .. rst-class:: classref-item-separator
  286. ----
  287. .. _class_StyleBoxFlat_property_shadow_color:
  288. .. rst-class:: classref-property
  289. :ref:`Color<class_Color>` **shadow_color** = ``Color(0, 0, 0, 0.6)``
  290. .. rst-class:: classref-property-setget
  291. - void **set_shadow_color** **(** :ref:`Color<class_Color>` value **)**
  292. - :ref:`Color<class_Color>` **get_shadow_color** **(** **)**
  293. The color of the shadow. This has no effect if :ref:`shadow_size<class_StyleBoxFlat_property_shadow_size>` is lower than 1.
  294. .. rst-class:: classref-item-separator
  295. ----
  296. .. _class_StyleBoxFlat_property_shadow_offset:
  297. .. rst-class:: classref-property
  298. :ref:`Vector2<class_Vector2>` **shadow_offset** = ``Vector2(0, 0)``
  299. .. rst-class:: classref-property-setget
  300. - void **set_shadow_offset** **(** :ref:`Vector2<class_Vector2>` value **)**
  301. - :ref:`Vector2<class_Vector2>` **get_shadow_offset** **(** **)**
  302. The shadow offset in pixels. Adjusts the position of the shadow relatively to the stylebox.
  303. .. rst-class:: classref-item-separator
  304. ----
  305. .. _class_StyleBoxFlat_property_shadow_size:
  306. .. rst-class:: classref-property
  307. :ref:`int<class_int>` **shadow_size** = ``0``
  308. .. rst-class:: classref-property-setget
  309. - void **set_shadow_size** **(** :ref:`int<class_int>` value **)**
  310. - :ref:`int<class_int>` **get_shadow_size** **(** **)**
  311. The shadow size in pixels.
  312. .. rst-class:: classref-item-separator
  313. ----
  314. .. _class_StyleBoxFlat_property_skew:
  315. .. rst-class:: classref-property
  316. :ref:`Vector2<class_Vector2>` **skew** = ``Vector2(0, 0)``
  317. .. rst-class:: classref-property-setget
  318. - void **set_skew** **(** :ref:`Vector2<class_Vector2>` value **)**
  319. - :ref:`Vector2<class_Vector2>` **get_skew** **(** **)**
  320. 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).
  321. \ **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.
  322. .. rst-class:: classref-section-separator
  323. ----
  324. .. rst-class:: classref-descriptions-group
  325. Method Descriptions
  326. -------------------
  327. .. _class_StyleBoxFlat_method_get_border_width:
  328. .. rst-class:: classref-method
  329. :ref:`int<class_int>` **get_border_width** **(** :ref:`Side<enum_@GlobalScope_Side>` margin **)** |const|
  330. Returns the specified :ref:`Side<enum_@GlobalScope_Side>`'s border width.
  331. .. rst-class:: classref-item-separator
  332. ----
  333. .. _class_StyleBoxFlat_method_get_border_width_min:
  334. .. rst-class:: classref-method
  335. :ref:`int<class_int>` **get_border_width_min** **(** **)** |const|
  336. Returns the smallest border width out of all four borders.
  337. .. rst-class:: classref-item-separator
  338. ----
  339. .. _class_StyleBoxFlat_method_get_corner_radius:
  340. .. rst-class:: classref-method
  341. :ref:`int<class_int>` **get_corner_radius** **(** :ref:`Corner<enum_@GlobalScope_Corner>` corner **)** |const|
  342. Returns the given ``corner``'s radius. See :ref:`Corner<enum_@GlobalScope_Corner>` for possible values.
  343. .. rst-class:: classref-item-separator
  344. ----
  345. .. _class_StyleBoxFlat_method_get_expand_margin:
  346. .. rst-class:: classref-method
  347. :ref:`float<class_float>` **get_expand_margin** **(** :ref:`Side<enum_@GlobalScope_Side>` margin **)** |const|
  348. Returns the size of the specified :ref:`Side<enum_@GlobalScope_Side>`'s expand margin.
  349. .. rst-class:: classref-item-separator
  350. ----
  351. .. _class_StyleBoxFlat_method_set_border_width:
  352. .. rst-class:: classref-method
  353. void **set_border_width** **(** :ref:`Side<enum_@GlobalScope_Side>` margin, :ref:`int<class_int>` width **)**
  354. Sets the specified :ref:`Side<enum_@GlobalScope_Side>`'s border width to ``width`` pixels.
  355. .. rst-class:: classref-item-separator
  356. ----
  357. .. _class_StyleBoxFlat_method_set_border_width_all:
  358. .. rst-class:: classref-method
  359. void **set_border_width_all** **(** :ref:`int<class_int>` width **)**
  360. Sets the border width to ``width`` pixels for all sides.
  361. .. rst-class:: classref-item-separator
  362. ----
  363. .. _class_StyleBoxFlat_method_set_corner_radius:
  364. .. rst-class:: classref-method
  365. void **set_corner_radius** **(** :ref:`Corner<enum_@GlobalScope_Corner>` corner, :ref:`int<class_int>` radius **)**
  366. Sets the corner radius to ``radius`` pixels for the given ``corner``. See :ref:`Corner<enum_@GlobalScope_Corner>` for possible values.
  367. .. rst-class:: classref-item-separator
  368. ----
  369. .. _class_StyleBoxFlat_method_set_corner_radius_all:
  370. .. rst-class:: classref-method
  371. void **set_corner_radius_all** **(** :ref:`int<class_int>` radius **)**
  372. Sets the corner radius to ``radius`` pixels for all corners.
  373. .. rst-class:: classref-item-separator
  374. ----
  375. .. _class_StyleBoxFlat_method_set_expand_margin:
  376. .. rst-class:: classref-method
  377. void **set_expand_margin** **(** :ref:`Side<enum_@GlobalScope_Side>` margin, :ref:`float<class_float>` size **)**
  378. Sets the expand margin to ``size`` pixels for the specified :ref:`Side<enum_@GlobalScope_Side>`.
  379. .. rst-class:: classref-item-separator
  380. ----
  381. .. _class_StyleBoxFlat_method_set_expand_margin_all:
  382. .. rst-class:: classref-method
  383. void **set_expand_margin_all** **(** :ref:`float<class_float>` size **)**
  384. Sets the expand margin to ``size`` pixels for all sides.
  385. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  386. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  387. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  388. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  389. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  390. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  391. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`