class_styleboxflat.rst 36 KB

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