Files
godot-docs-l10n/classes/es/class_styleboxflat.rst
2025-09-30 13:31:55 +02:00

668 lines
34 KiB
ReStructuredText

:github_url: hide
.. _class_StyleBoxFlat:
StyleBoxFlat
============
**Hereda:** :ref:`StyleBox<class_StyleBox>` **<** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
Un :ref:`StyleBox<class_StyleBox>` personalizable que no utiliza textura.
.. rst-class:: classref-introduction-group
Descripción
----------------------
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.
Setting corner radius to high values is allowed. As soon as corners overlap, the stylebox will switch to a relative system:
.. code:: text
height = 30
corner_radius_top_left = 50
corner_radius_bottom_left = 100
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:
.. code:: text
corner_radius_top_left: 10
corner_radius_bottom_left: 20
.. rst-class:: classref-reftable-group
Propiedades
----------------------
.. table::
:widths: auto
+-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
| :ref:`bool<class_bool>` | :ref:`anti_aliasing<class_StyleBoxFlat_property_anti_aliasing>` | ``true`` |
+-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
| :ref:`float<class_float>` | :ref:`anti_aliasing_size<class_StyleBoxFlat_property_anti_aliasing_size>` | ``1.0`` |
+-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
| :ref:`Color<class_Color>` | :ref:`bg_color<class_StyleBoxFlat_property_bg_color>` | ``Color(0.6, 0.6, 0.6, 1)`` |
+-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
| :ref:`bool<class_bool>` | :ref:`border_blend<class_StyleBoxFlat_property_border_blend>` | ``false`` |
+-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
| :ref:`Color<class_Color>` | :ref:`border_color<class_StyleBoxFlat_property_border_color>` | ``Color(0.8, 0.8, 0.8, 1)`` |
+-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
| :ref:`int<class_int>` | :ref:`border_width_bottom<class_StyleBoxFlat_property_border_width_bottom>` | ``0`` |
+-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
| :ref:`int<class_int>` | :ref:`border_width_left<class_StyleBoxFlat_property_border_width_left>` | ``0`` |
+-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
| :ref:`int<class_int>` | :ref:`border_width_right<class_StyleBoxFlat_property_border_width_right>` | ``0`` |
+-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
| :ref:`int<class_int>` | :ref:`border_width_top<class_StyleBoxFlat_property_border_width_top>` | ``0`` |
+-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
| :ref:`int<class_int>` | :ref:`corner_detail<class_StyleBoxFlat_property_corner_detail>` | ``8`` |
+-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
| :ref:`int<class_int>` | :ref:`corner_radius_bottom_left<class_StyleBoxFlat_property_corner_radius_bottom_left>` | ``0`` |
+-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
| :ref:`int<class_int>` | :ref:`corner_radius_bottom_right<class_StyleBoxFlat_property_corner_radius_bottom_right>` | ``0`` |
+-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
| :ref:`int<class_int>` | :ref:`corner_radius_top_left<class_StyleBoxFlat_property_corner_radius_top_left>` | ``0`` |
+-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
| :ref:`int<class_int>` | :ref:`corner_radius_top_right<class_StyleBoxFlat_property_corner_radius_top_right>` | ``0`` |
+-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
| :ref:`bool<class_bool>` | :ref:`draw_center<class_StyleBoxFlat_property_draw_center>` | ``true`` |
+-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
| :ref:`float<class_float>` | :ref:`expand_margin_bottom<class_StyleBoxFlat_property_expand_margin_bottom>` | ``0.0`` |
+-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
| :ref:`float<class_float>` | :ref:`expand_margin_left<class_StyleBoxFlat_property_expand_margin_left>` | ``0.0`` |
+-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
| :ref:`float<class_float>` | :ref:`expand_margin_right<class_StyleBoxFlat_property_expand_margin_right>` | ``0.0`` |
+-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
| :ref:`float<class_float>` | :ref:`expand_margin_top<class_StyleBoxFlat_property_expand_margin_top>` | ``0.0`` |
+-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
| :ref:`Color<class_Color>` | :ref:`shadow_color<class_StyleBoxFlat_property_shadow_color>` | ``Color(0, 0, 0, 0.6)`` |
+-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`shadow_offset<class_StyleBoxFlat_property_shadow_offset>` | ``Vector2(0, 0)`` |
+-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
| :ref:`int<class_int>` | :ref:`shadow_size<class_StyleBoxFlat_property_shadow_size>` | ``0`` |
+-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`skew<class_StyleBoxFlat_property_skew>` | ``Vector2(0, 0)`` |
+-------------------------------+-------------------------------------------------------------------------------------------+-----------------------------+
.. rst-class:: classref-reftable-group
Métodos
--------------
.. table::
:widths: auto
+---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_border_width<class_StyleBoxFlat_method_get_border_width>`\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const| |
+---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_border_width_min<class_StyleBoxFlat_method_get_border_width_min>`\ (\ ) |const| |
+---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_corner_radius<class_StyleBoxFlat_method_get_corner_radius>`\ (\ corner\: :ref:`Corner<enum_@GlobalScope_Corner>`\ ) |const| |
+---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_expand_margin<class_StyleBoxFlat_method_get_expand_margin>`\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const| |
+---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`set_border_width<class_StyleBoxFlat_method_set_border_width>`\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`, width\: :ref:`int<class_int>`\ ) |
+---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`set_border_width_all<class_StyleBoxFlat_method_set_border_width_all>`\ (\ width\: :ref:`int<class_int>`\ ) |
+---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`set_corner_radius<class_StyleBoxFlat_method_set_corner_radius>`\ (\ corner\: :ref:`Corner<enum_@GlobalScope_Corner>`, radius\: :ref:`int<class_int>`\ ) |
+---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`set_corner_radius_all<class_StyleBoxFlat_method_set_corner_radius_all>`\ (\ radius\: :ref:`int<class_int>`\ ) |
+---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`set_expand_margin<class_StyleBoxFlat_method_set_expand_margin>`\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`, size\: :ref:`float<class_float>`\ ) |
+---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`set_expand_margin_all<class_StyleBoxFlat_method_set_expand_margin_all>`\ (\ size\: :ref:`float<class_float>`\ ) |
+---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Descripciones de Propiedades
--------------------------------------------------------
.. _class_StyleBoxFlat_property_anti_aliasing:
.. rst-class:: classref-property
:ref:`bool<class_bool>` **anti_aliasing** = ``true`` :ref:`🔗<class_StyleBoxFlat_property_anti_aliasing>`
.. rst-class:: classref-property-setget
- |void| **set_anti_aliased**\ (\ value\: :ref:`bool<class_bool>`\ )
- :ref:`bool<class_bool>` **is_anti_aliased**\ (\ )
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>`.
\ **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.
.. rst-class:: classref-item-separator
----
.. _class_StyleBoxFlat_property_anti_aliasing_size:
.. rst-class:: classref-property
:ref:`float<class_float>` **anti_aliasing_size** = ``1.0`` :ref:`🔗<class_StyleBoxFlat_property_anti_aliasing_size>`
.. rst-class:: classref-property-setget
- |void| **set_aa_size**\ (\ value\: :ref:`float<class_float>`\ )
- :ref:`float<class_float>` **get_aa_size**\ (\ )
Esto cambia el tamaño del efecto de antialiasing. Se recomienda ``1.0`` para un resultado óptimo a escala 100%, idéntico a como se renderizan los rectángulos redondeados en los navegadores web y en la mayoría de los programas de dibujo vectorial.
\ **Nota:** Los valores más altos pueden producir un efecto de desenfoque, pero también pueden crear artefactos no deseados en cajas pequeñas con esquinas de gran radio.
.. rst-class:: classref-item-separator
----
.. _class_StyleBoxFlat_property_bg_color:
.. rst-class:: classref-property
:ref:`Color<class_Color>` **bg_color** = ``Color(0.6, 0.6, 0.6, 1)`` :ref:`🔗<class_StyleBoxFlat_property_bg_color>`
.. rst-class:: classref-property-setget
- |void| **set_bg_color**\ (\ value\: :ref:`Color<class_Color>`\ )
- :ref:`Color<class_Color>` **get_bg_color**\ (\ )
El color de fondo de la caja de estilo.
.. rst-class:: classref-item-separator
----
.. _class_StyleBoxFlat_property_border_blend:
.. rst-class:: classref-property
:ref:`bool<class_bool>` **border_blend** = ``false`` :ref:`🔗<class_StyleBoxFlat_property_border_blend>`
.. rst-class:: classref-property-setget
- |void| **set_border_blend**\ (\ value\: :ref:`bool<class_bool>`\ )
- :ref:`bool<class_bool>` **get_border_blend**\ (\ )
Si es ``true``, el borde se desvanecerá en el color de fondo.
.. rst-class:: classref-item-separator
----
.. _class_StyleBoxFlat_property_border_color:
.. rst-class:: classref-property
:ref:`Color<class_Color>` **border_color** = ``Color(0.8, 0.8, 0.8, 1)`` :ref:`🔗<class_StyleBoxFlat_property_border_color>`
.. rst-class:: classref-property-setget
- |void| **set_border_color**\ (\ value\: :ref:`Color<class_Color>`\ )
- :ref:`Color<class_Color>` **get_border_color**\ (\ )
Establece el color del borde.
.. rst-class:: classref-item-separator
----
.. _class_StyleBoxFlat_property_border_width_bottom:
.. rst-class:: classref-property
:ref:`int<class_int>` **border_width_bottom** = ``0`` :ref:`🔗<class_StyleBoxFlat_property_border_width_bottom>`
.. rst-class:: classref-property-setget
- |void| **set_border_width**\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`, width\: :ref:`int<class_int>`\ )
- :ref:`int<class_int>` **get_border_width**\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const|
Ancho del borde para el borde inferior.
.. rst-class:: classref-item-separator
----
.. _class_StyleBoxFlat_property_border_width_left:
.. rst-class:: classref-property
:ref:`int<class_int>` **border_width_left** = ``0`` :ref:`🔗<class_StyleBoxFlat_property_border_width_left>`
.. rst-class:: classref-property-setget
- |void| **set_border_width**\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`, width\: :ref:`int<class_int>`\ )
- :ref:`int<class_int>` **get_border_width**\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const|
Ancho del borde para el borde izquierdo.
.. rst-class:: classref-item-separator
----
.. _class_StyleBoxFlat_property_border_width_right:
.. rst-class:: classref-property
:ref:`int<class_int>` **border_width_right** = ``0`` :ref:`🔗<class_StyleBoxFlat_property_border_width_right>`
.. rst-class:: classref-property-setget
- |void| **set_border_width**\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`, width\: :ref:`int<class_int>`\ )
- :ref:`int<class_int>` **get_border_width**\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const|
Ancho del borde para el borde derecho.
.. rst-class:: classref-item-separator
----
.. _class_StyleBoxFlat_property_border_width_top:
.. rst-class:: classref-property
:ref:`int<class_int>` **border_width_top** = ``0`` :ref:`🔗<class_StyleBoxFlat_property_border_width_top>`
.. rst-class:: classref-property-setget
- |void| **set_border_width**\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`, width\: :ref:`int<class_int>`\ )
- :ref:`int<class_int>` **get_border_width**\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const|
Ancho del borde para el borde superior.
.. rst-class:: classref-item-separator
----
.. _class_StyleBoxFlat_property_corner_detail:
.. rst-class:: classref-property
:ref:`int<class_int>` **corner_detail** = ``8`` :ref:`🔗<class_StyleBoxFlat_property_corner_detail>`
.. rst-class:: classref-property-setget
- |void| **set_corner_detail**\ (\ value\: :ref:`int<class_int>`\ )
- :ref:`int<class_int>` **get_corner_detail**\ (\ )
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.
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.
A corner detail of ``1`` will result in chamfered corners instead of rounded corners, which is useful for some artistic effects.
.. rst-class:: classref-item-separator
----
.. _class_StyleBoxFlat_property_corner_radius_bottom_left:
.. rst-class:: classref-property
:ref:`int<class_int>` **corner_radius_bottom_left** = ``0`` :ref:`🔗<class_StyleBoxFlat_property_corner_radius_bottom_left>`
.. rst-class:: classref-property-setget
- |void| **set_corner_radius**\ (\ corner\: :ref:`Corner<enum_@GlobalScope_Corner>`, radius\: :ref:`int<class_int>`\ )
- :ref:`int<class_int>` **get_corner_radius**\ (\ corner\: :ref:`Corner<enum_@GlobalScope_Corner>`\ ) |const|
El radio de la esquina inferior izquierda. Si ``0``, la esquina no está redondeada.
.. rst-class:: classref-item-separator
----
.. _class_StyleBoxFlat_property_corner_radius_bottom_right:
.. rst-class:: classref-property
:ref:`int<class_int>` **corner_radius_bottom_right** = ``0`` :ref:`🔗<class_StyleBoxFlat_property_corner_radius_bottom_right>`
.. rst-class:: classref-property-setget
- |void| **set_corner_radius**\ (\ corner\: :ref:`Corner<enum_@GlobalScope_Corner>`, radius\: :ref:`int<class_int>`\ )
- :ref:`int<class_int>` **get_corner_radius**\ (\ corner\: :ref:`Corner<enum_@GlobalScope_Corner>`\ ) |const|
El radio de la esquina inferior derecha. Si ``0``, la esquina no está redondeada.
.. rst-class:: classref-item-separator
----
.. _class_StyleBoxFlat_property_corner_radius_top_left:
.. rst-class:: classref-property
:ref:`int<class_int>` **corner_radius_top_left** = ``0`` :ref:`🔗<class_StyleBoxFlat_property_corner_radius_top_left>`
.. rst-class:: classref-property-setget
- |void| **set_corner_radius**\ (\ corner\: :ref:`Corner<enum_@GlobalScope_Corner>`, radius\: :ref:`int<class_int>`\ )
- :ref:`int<class_int>` **get_corner_radius**\ (\ corner\: :ref:`Corner<enum_@GlobalScope_Corner>`\ ) |const|
El radio de la esquina superior izquierda. Si ``0``, la esquina no está redondeada.
.. rst-class:: classref-item-separator
----
.. _class_StyleBoxFlat_property_corner_radius_top_right:
.. rst-class:: classref-property
:ref:`int<class_int>` **corner_radius_top_right** = ``0`` :ref:`🔗<class_StyleBoxFlat_property_corner_radius_top_right>`
.. rst-class:: classref-property-setget
- |void| **set_corner_radius**\ (\ corner\: :ref:`Corner<enum_@GlobalScope_Corner>`, radius\: :ref:`int<class_int>`\ )
- :ref:`int<class_int>` **get_corner_radius**\ (\ corner\: :ref:`Corner<enum_@GlobalScope_Corner>`\ ) |const|
El radio de la esquina superior derecha. Si ``0``, la esquina no está redondeada.
.. rst-class:: classref-item-separator
----
.. _class_StyleBoxFlat_property_draw_center:
.. rst-class:: classref-property
:ref:`bool<class_bool>` **draw_center** = ``true`` :ref:`🔗<class_StyleBoxFlat_property_draw_center>`
.. rst-class:: classref-property-setget
- |void| **set_draw_center**\ (\ value\: :ref:`bool<class_bool>`\ )
- :ref:`bool<class_bool>` **is_draw_center_enabled**\ (\ )
Cambia el dibujo de la parte interior de la caja de estilo.
.. rst-class:: classref-item-separator
----
.. _class_StyleBoxFlat_property_expand_margin_bottom:
.. rst-class:: classref-property
:ref:`float<class_float>` **expand_margin_bottom** = ``0.0`` :ref:`🔗<class_StyleBoxFlat_property_expand_margin_bottom>`
.. rst-class:: classref-property-setget
- |void| **set_expand_margin**\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`, size\: :ref:`float<class_float>`\ )
- :ref:`float<class_float>` **get_expand_margin**\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const|
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.
\ **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.
.. rst-class:: classref-item-separator
----
.. _class_StyleBoxFlat_property_expand_margin_left:
.. rst-class:: classref-property
:ref:`float<class_float>` **expand_margin_left** = ``0.0`` :ref:`🔗<class_StyleBoxFlat_property_expand_margin_left>`
.. rst-class:: classref-property-setget
- |void| **set_expand_margin**\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`, size\: :ref:`float<class_float>`\ )
- :ref:`float<class_float>` **get_expand_margin**\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const|
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.
\ **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.
.. rst-class:: classref-item-separator
----
.. _class_StyleBoxFlat_property_expand_margin_right:
.. rst-class:: classref-property
:ref:`float<class_float>` **expand_margin_right** = ``0.0`` :ref:`🔗<class_StyleBoxFlat_property_expand_margin_right>`
.. rst-class:: classref-property-setget
- |void| **set_expand_margin**\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`, size\: :ref:`float<class_float>`\ )
- :ref:`float<class_float>` **get_expand_margin**\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const|
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.
\ **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.
.. rst-class:: classref-item-separator
----
.. _class_StyleBoxFlat_property_expand_margin_top:
.. rst-class:: classref-property
:ref:`float<class_float>` **expand_margin_top** = ``0.0`` :ref:`🔗<class_StyleBoxFlat_property_expand_margin_top>`
.. rst-class:: classref-property-setget
- |void| **set_expand_margin**\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`, size\: :ref:`float<class_float>`\ )
- :ref:`float<class_float>` **get_expand_margin**\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const|
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.
\ **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.
.. rst-class:: classref-item-separator
----
.. _class_StyleBoxFlat_property_shadow_color:
.. rst-class:: classref-property
:ref:`Color<class_Color>` **shadow_color** = ``Color(0, 0, 0, 0.6)`` :ref:`🔗<class_StyleBoxFlat_property_shadow_color>`
.. rst-class:: classref-property-setget
- |void| **set_shadow_color**\ (\ value\: :ref:`Color<class_Color>`\ )
- :ref:`Color<class_Color>` **get_shadow_color**\ (\ )
El color de la sombra. Esto no tiene efecto si :ref:`shadow_size<class_StyleBoxFlat_property_shadow_size>` es inferior a 1.
.. rst-class:: classref-item-separator
----
.. _class_StyleBoxFlat_property_shadow_offset:
.. rst-class:: classref-property
:ref:`Vector2<class_Vector2>` **shadow_offset** = ``Vector2(0, 0)`` :ref:`🔗<class_StyleBoxFlat_property_shadow_offset>`
.. rst-class:: classref-property-setget
- |void| **set_shadow_offset**\ (\ value\: :ref:`Vector2<class_Vector2>`\ )
- :ref:`Vector2<class_Vector2>` **get_shadow_offset**\ (\ )
El desplazamiento de la sombra en píxeles. Ajusta la posición de la sombra relativamente al stylebox.
.. rst-class:: classref-item-separator
----
.. _class_StyleBoxFlat_property_shadow_size:
.. rst-class:: classref-property
:ref:`int<class_int>` **shadow_size** = ``0`` :ref:`🔗<class_StyleBoxFlat_property_shadow_size>`
.. rst-class:: classref-property-setget
- |void| **set_shadow_size**\ (\ value\: :ref:`int<class_int>`\ )
- :ref:`int<class_int>` **get_shadow_size**\ (\ )
El tamaño de la sombra en píxeles.
.. rst-class:: classref-item-separator
----
.. _class_StyleBoxFlat_property_skew:
.. rst-class:: classref-property
:ref:`Vector2<class_Vector2>` **skew** = ``Vector2(0, 0)`` :ref:`🔗<class_StyleBoxFlat_property_skew>`
.. rst-class:: classref-property-setget
- |void| **set_skew**\ (\ value\: :ref:`Vector2<class_Vector2>`\ )
- :ref:`Vector2<class_Vector2>` **get_skew**\ (\ )
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).
\ **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.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Descripciones de Métodos
------------------------------------------------
.. _class_StyleBoxFlat_method_get_border_width:
.. rst-class:: classref-method
:ref:`int<class_int>` **get_border_width**\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const| :ref:`🔗<class_StyleBoxFlat_method_get_border_width>`
Devuelve el ancho del borde del :ref:`Side<enum_@GlobalScope_Side>` especificado.
.. rst-class:: classref-item-separator
----
.. _class_StyleBoxFlat_method_get_border_width_min:
.. rst-class:: classref-method
:ref:`int<class_int>` **get_border_width_min**\ (\ ) |const| :ref:`🔗<class_StyleBoxFlat_method_get_border_width_min>`
Devuelve el menor ancho de borde de los cuatro bordes.
.. rst-class:: classref-item-separator
----
.. _class_StyleBoxFlat_method_get_corner_radius:
.. rst-class:: classref-method
:ref:`int<class_int>` **get_corner_radius**\ (\ corner\: :ref:`Corner<enum_@GlobalScope_Corner>`\ ) |const| :ref:`🔗<class_StyleBoxFlat_method_get_corner_radius>`
Devuelve el radio del ``corner`` dado.
.. rst-class:: classref-item-separator
----
.. _class_StyleBoxFlat_method_get_expand_margin:
.. rst-class:: classref-method
:ref:`float<class_float>` **get_expand_margin**\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`\ ) |const| :ref:`🔗<class_StyleBoxFlat_method_get_expand_margin>`
Devuelve el tamaño del margen de expansión del :ref:`Side<enum_@GlobalScope_Side>` especificado.
.. rst-class:: classref-item-separator
----
.. _class_StyleBoxFlat_method_set_border_width:
.. rst-class:: classref-method
|void| **set_border_width**\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`, width\: :ref:`int<class_int>`\ ) :ref:`🔗<class_StyleBoxFlat_method_set_border_width>`
Establece el ancho del borde del :ref:`Side<enum_@GlobalScope_Side>` especificado en ``width`` píxeles.
.. rst-class:: classref-item-separator
----
.. _class_StyleBoxFlat_method_set_border_width_all:
.. rst-class:: classref-method
|void| **set_border_width_all**\ (\ width\: :ref:`int<class_int>`\ ) :ref:`🔗<class_StyleBoxFlat_method_set_border_width_all>`
Establece el ancho del borde a ``width`` píxeles para todos los lados.
.. rst-class:: classref-item-separator
----
.. _class_StyleBoxFlat_method_set_corner_radius:
.. rst-class:: classref-method
|void| **set_corner_radius**\ (\ corner\: :ref:`Corner<enum_@GlobalScope_Corner>`, radius\: :ref:`int<class_int>`\ ) :ref:`🔗<class_StyleBoxFlat_method_set_corner_radius>`
Establece el radio de la esquina a ``radius`` píxeles para la ``corner`` dada.
.. rst-class:: classref-item-separator
----
.. _class_StyleBoxFlat_method_set_corner_radius_all:
.. rst-class:: classref-method
|void| **set_corner_radius_all**\ (\ radius\: :ref:`int<class_int>`\ ) :ref:`🔗<class_StyleBoxFlat_method_set_corner_radius_all>`
Establece el radio de la esquina a ``radius`` píxeles para todas las esquinas.
.. rst-class:: classref-item-separator
----
.. _class_StyleBoxFlat_method_set_expand_margin:
.. rst-class:: classref-method
|void| **set_expand_margin**\ (\ margin\: :ref:`Side<enum_@GlobalScope_Side>`, size\: :ref:`float<class_float>`\ ) :ref:`🔗<class_StyleBoxFlat_method_set_expand_margin>`
Establece el margen de expansión a ``size`` píxeles para el :ref:`Side<enum_@GlobalScope_Side>` especificado.
.. rst-class:: classref-item-separator
----
.. _class_StyleBoxFlat_method_set_expand_margin_all:
.. rst-class:: classref-method
|void| **set_expand_margin_all**\ (\ size\: :ref:`float<class_float>`\ ) :ref:`🔗<class_StyleBoxFlat_method_set_expand_margin_all>`
Establece el margen de expansión a ``size`` píxeles para todos los lados.
.. |virtual| replace:: :abbr:`virtual (Normalmente, este método debería ser sobreescrito por el usuario para que tenga algún efecto.)`
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
.. |const| replace:: :abbr:`const (Este método no tiene efectos secundarios. No modifica ninguna de las variables miembro de la instancia.)`
.. |vararg| replace:: :abbr:`vararg (Este método permite agregar cualquier número de argumentos después de los descritos aquí.)`
.. |constructor| replace:: :abbr:`constructor (Este método se utiliza para construir un tipo.)`
.. |static| replace:: :abbr:`static (Este método no necesita una instancia para ser llamado, por lo que puede llamarse directamente utilizando el nombre de la clase.)`
.. |operator| replace:: :abbr:`operator (Este método describe un operador válido para usar con este tipo como operando izquierdo.)`
.. |bitfield| replace:: :abbr:`BitField (Este valor es un entero compuesto como una máscara de bits de las siguientes banderas.)`
.. |void| replace:: :abbr:`void (Sin valor de retorno.)`