class_styleboxflat.rst 31 KB

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