:github_url: hide .. _class_StyleBoxTexture: StyleBoxTexture =============== **Eredita:** :ref:`StyleBox` **<** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` Uno :ref:`StyleBox` divisa in nove sezioni basata su una texture. .. rst-class:: classref-introduction-group Descrizione ---------------------- Uno :ref:`StyleBox` a nove sezioni basato su texture, in un modo simile a :ref:`NinePatchRect`. Questo stylebox esegue un ridimensionamento 3×3 di una texture, dove solo la cella centrale è completamente stirata. Ciò rende possibile progettare stili con bordi a prescindere dalle dimensioni dello stylebox. .. rst-class:: classref-reftable-group Proprietà ------------------ .. table:: :widths: auto +--------------------------------------------------------------+----------------------------------------------------------------------------------------+-----------------------+ | :ref:`AxisStretchMode` | :ref:`axis_stretch_horizontal` | ``0`` | +--------------------------------------------------------------+----------------------------------------------------------------------------------------+-----------------------+ | :ref:`AxisStretchMode` | :ref:`axis_stretch_vertical` | ``0`` | +--------------------------------------------------------------+----------------------------------------------------------------------------------------+-----------------------+ | :ref:`bool` | :ref:`draw_center` | ``true`` | +--------------------------------------------------------------+----------------------------------------------------------------------------------------+-----------------------+ | :ref:`float` | :ref:`expand_margin_bottom` | ``0.0`` | +--------------------------------------------------------------+----------------------------------------------------------------------------------------+-----------------------+ | :ref:`float` | :ref:`expand_margin_left` | ``0.0`` | +--------------------------------------------------------------+----------------------------------------------------------------------------------------+-----------------------+ | :ref:`float` | :ref:`expand_margin_right` | ``0.0`` | +--------------------------------------------------------------+----------------------------------------------------------------------------------------+-----------------------+ | :ref:`float` | :ref:`expand_margin_top` | ``0.0`` | +--------------------------------------------------------------+----------------------------------------------------------------------------------------+-----------------------+ | :ref:`Color` | :ref:`modulate_color` | ``Color(1, 1, 1, 1)`` | +--------------------------------------------------------------+----------------------------------------------------------------------------------------+-----------------------+ | :ref:`Rect2` | :ref:`region_rect` | ``Rect2(0, 0, 0, 0)`` | +--------------------------------------------------------------+----------------------------------------------------------------------------------------+-----------------------+ | :ref:`Texture2D` | :ref:`texture` | | +--------------------------------------------------------------+----------------------------------------------------------------------------------------+-----------------------+ | :ref:`float` | :ref:`texture_margin_bottom` | ``0.0`` | +--------------------------------------------------------------+----------------------------------------------------------------------------------------+-----------------------+ | :ref:`float` | :ref:`texture_margin_left` | ``0.0`` | +--------------------------------------------------------------+----------------------------------------------------------------------------------------+-----------------------+ | :ref:`float` | :ref:`texture_margin_right` | ``0.0`` | +--------------------------------------------------------------+----------------------------------------------------------------------------------------+-----------------------+ | :ref:`float` | :ref:`texture_margin_top` | ``0.0`` | +--------------------------------------------------------------+----------------------------------------------------------------------------------------+-----------------------+ .. rst-class:: classref-reftable-group Metodi ------------ .. table:: :widths: auto +---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_expand_margin`\ (\ margin\: :ref:`Side`\ ) |const| | +---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_texture_margin`\ (\ margin\: :ref:`Side`\ ) |const| | +---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`set_expand_margin`\ (\ margin\: :ref:`Side`, size\: :ref:`float`\ ) | +---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`set_expand_margin_all`\ (\ size\: :ref:`float`\ ) | +---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`set_texture_margin`\ (\ margin\: :ref:`Side`, size\: :ref:`float`\ ) | +---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`set_texture_margin_all`\ (\ size\: :ref:`float`\ ) | +---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Enumerazioni ------------------------ .. _enum_StyleBoxTexture_AxisStretchMode: .. rst-class:: classref-enumeration enum **AxisStretchMode**: :ref:`🔗` .. _class_StyleBoxTexture_constant_AXIS_STRETCH_MODE_STRETCH: .. rst-class:: classref-enumeration-constant :ref:`AxisStretchMode` **AXIS_STRETCH_MODE_STRETCH** = ``0`` Allunga la texture dello stylebox. Ciò provoca una distorsione visiva a meno che la dimensione della texture non corrisponda perfettamente a quella dello stylebox. .. _class_StyleBoxTexture_constant_AXIS_STRETCH_MODE_TILE: .. rst-class:: classref-enumeration-constant :ref:`AxisStretchMode` **AXIS_STRETCH_MODE_TILE** = ``1`` Ripete la texture dello stylebox per adattarla alle dimensioni dello stylebox secondo il sistema a nove sezioni. .. _class_StyleBoxTexture_constant_AXIS_STRETCH_MODE_TILE_FIT: .. rst-class:: classref-enumeration-constant :ref:`AxisStretchMode` **AXIS_STRETCH_MODE_TILE_FIT** = ``2`` Ripete la texture dello stylebox per adattarla alle dimensioni dello stylebox secondo il sistema a nove sezioni. A differenza di :ref:`AXIS_STRETCH_MODE_TILE`, la texture può essere leggermente allungata per ripetere la texture a nove sezioni, senza cuciture. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Descrizioni delle proprietà ------------------------------------------------------ .. _class_StyleBoxTexture_property_axis_stretch_horizontal: .. rst-class:: classref-property :ref:`AxisStretchMode` **axis_stretch_horizontal** = ``0`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_h_axis_stretch_mode**\ (\ value\: :ref:`AxisStretchMode`\ ) - :ref:`AxisStretchMode` **get_h_axis_stretch_mode**\ (\ ) Controlla come la texture dello stylebox sarà allungata o ripetuta orizzontalmente. .. rst-class:: classref-item-separator ---- .. _class_StyleBoxTexture_property_axis_stretch_vertical: .. rst-class:: classref-property :ref:`AxisStretchMode` **axis_stretch_vertical** = ``0`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_v_axis_stretch_mode**\ (\ value\: :ref:`AxisStretchMode`\ ) - :ref:`AxisStretchMode` **get_v_axis_stretch_mode**\ (\ ) Controlla come la texture dello stylebox sarà allungata o ripetuta verticalmente. .. rst-class:: classref-item-separator ---- .. _class_StyleBoxTexture_property_draw_center: .. rst-class:: classref-property :ref:`bool` **draw_center** = ``true`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_draw_center**\ (\ value\: :ref:`bool`\ ) - :ref:`bool` **is_draw_center_enabled**\ (\ ) Se ``true``, sarà disegnata la sezione centrale della texture a nove sezioni. .. rst-class:: classref-item-separator ---- .. _class_StyleBoxTexture_property_expand_margin_bottom: .. rst-class:: classref-property :ref:`float` **expand_margin_bottom** = ``0.0`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_expand_margin**\ (\ margin\: :ref:`Side`, size\: :ref:`float`\ ) - :ref:`float` **get_expand_margin**\ (\ margin\: :ref:`Side`\ ) |const| Espande il margine inferiore di questo style box quando viene disegnato, in modo che sia più grande di quanto richiesto. .. rst-class:: classref-item-separator ---- .. _class_StyleBoxTexture_property_expand_margin_left: .. rst-class:: classref-property :ref:`float` **expand_margin_left** = ``0.0`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_expand_margin**\ (\ margin\: :ref:`Side`, size\: :ref:`float`\ ) - :ref:`float` **get_expand_margin**\ (\ margin\: :ref:`Side`\ ) |const| Espande il margine sinistro di questo style box quando viene disegnato, in modo che sia più grande di quanto richiesto. .. rst-class:: classref-item-separator ---- .. _class_StyleBoxTexture_property_expand_margin_right: .. rst-class:: classref-property :ref:`float` **expand_margin_right** = ``0.0`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_expand_margin**\ (\ margin\: :ref:`Side`, size\: :ref:`float`\ ) - :ref:`float` **get_expand_margin**\ (\ margin\: :ref:`Side`\ ) |const| Espande il margine destro di questo style box quando viene disegnato, in modo che sia più grande di quanto richiesto. .. rst-class:: classref-item-separator ---- .. _class_StyleBoxTexture_property_expand_margin_top: .. rst-class:: classref-property :ref:`float` **expand_margin_top** = ``0.0`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_expand_margin**\ (\ margin\: :ref:`Side`, size\: :ref:`float`\ ) - :ref:`float` **get_expand_margin**\ (\ margin\: :ref:`Side`\ ) |const| Espande il margine superiore di questo style box quando viene disegnato, in modo che sia più grande di quanto richiesto. .. rst-class:: classref-item-separator ---- .. _class_StyleBoxTexture_property_modulate_color: .. rst-class:: classref-property :ref:`Color` **modulate_color** = ``Color(1, 1, 1, 1)`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_modulate**\ (\ value\: :ref:`Color`\ ) - :ref:`Color` **get_modulate**\ (\ ) Modula il colore della texture quando viene disegnato questo style box. .. rst-class:: classref-item-separator ---- .. _class_StyleBoxTexture_property_region_rect: .. rst-class:: classref-property :ref:`Rect2` **region_rect** = ``Rect2(0, 0, 0, 0)`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_region_rect**\ (\ value\: :ref:`Rect2`\ ) - :ref:`Rect2` **get_region_rect**\ (\ ) La regione da usare dalla :ref:`texture`. Ciò equivale a racchiudere prima la :ref:`texture` in un :ref:`AtlasTexture` con la stessa regione. Se vuoto (``Rect2(0, 0, 0, 0)``), sarà usata l'intera :ref:`texture`. .. rst-class:: classref-item-separator ---- .. _class_StyleBoxTexture_property_texture: .. rst-class:: classref-property :ref:`Texture2D` **texture** :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_texture**\ (\ value\: :ref:`Texture2D`\ ) - :ref:`Texture2D` **get_texture**\ (\ ) La texture da utilizzare quando si disegna questo style box. .. rst-class:: classref-item-separator ---- .. _class_StyleBoxTexture_property_texture_margin_bottom: .. rst-class:: classref-property :ref:`float` **texture_margin_bottom** = ``0.0`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_texture_margin**\ (\ margin\: :ref:`Side`, size\: :ref:`float`\ ) - :ref:`float` **get_texture_margin**\ (\ margin\: :ref:`Side`\ ) |const| Aumenta il margine inferiore del riquadro 3×3 della texture . Un valore più alto significa che una parte maggiore della texture sorgente è considerata parte del bordo inferiore del riquadro 3×3. Questo è anche il valore utilizzato come riserva per :ref:`StyleBox.content_margin_bottom` se è negativo. .. rst-class:: classref-item-separator ---- .. _class_StyleBoxTexture_property_texture_margin_left: .. rst-class:: classref-property :ref:`float` **texture_margin_left** = ``0.0`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_texture_margin**\ (\ margin\: :ref:`Side`, size\: :ref:`float`\ ) - :ref:`float` **get_texture_margin**\ (\ margin\: :ref:`Side`\ ) |const| Aumenta il margine sinistro del riquadro 3×3 della texture . Un valore più alto significa che una parte maggiore della texture sorgente è considerata parte del bordo sinistro del riquadro 3×3. Questo è anche il valore utilizzato come riserva per :ref:`StyleBox.content_margin_left` se è negativo. .. rst-class:: classref-item-separator ---- .. _class_StyleBoxTexture_property_texture_margin_right: .. rst-class:: classref-property :ref:`float` **texture_margin_right** = ``0.0`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_texture_margin**\ (\ margin\: :ref:`Side`, size\: :ref:`float`\ ) - :ref:`float` **get_texture_margin**\ (\ margin\: :ref:`Side`\ ) |const| Aumenta il margine destro del riquadro 3×3 della texture . Un valore più alto significa che una parte maggiore della texture sorgente è considerata parte del bordo destro del riquadro 3×3. Questo è anche il valore utilizzato come riserva per :ref:`StyleBox.content_margin_right` se è negativo. .. rst-class:: classref-item-separator ---- .. _class_StyleBoxTexture_property_texture_margin_top: .. rst-class:: classref-property :ref:`float` **texture_margin_top** = ``0.0`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_texture_margin**\ (\ margin\: :ref:`Side`, size\: :ref:`float`\ ) - :ref:`float` **get_texture_margin**\ (\ margin\: :ref:`Side`\ ) |const| Aumenta il margine superiore del riquadro 3×3 della texture . Un valore più alto significa che una parte maggiore della texture sorgente è considerata parte del bordo superiore del riquadro 3×3. Questo è anche il valore utilizzato come riserva per :ref:`StyleBox.content_margin_top` se è negativo. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Descrizioni dei metodi -------------------------------------------- .. _class_StyleBoxTexture_method_get_expand_margin: .. rst-class:: classref-method :ref:`float` **get_expand_margin**\ (\ margin\: :ref:`Side`\ ) |const| :ref:`🔗` Restituisce la dimensione del margine di espansione del lato specificato come :ref:`Side`. .. rst-class:: classref-item-separator ---- .. _class_StyleBoxTexture_method_get_texture_margin: .. rst-class:: classref-method :ref:`float` **get_texture_margin**\ (\ margin\: :ref:`Side`\ ) |const| :ref:`🔗` Restituisce la dimensione del margine del lato specificato come :ref:`Side`. .. rst-class:: classref-item-separator ---- .. _class_StyleBoxTexture_method_set_expand_margin: .. rst-class:: classref-method |void| **set_expand_margin**\ (\ margin\: :ref:`Side`, size\: :ref:`float`\ ) :ref:`🔗` Imposta il margine di espansione a ``size`` pixel per il lato specificato con :ref:`Side`. .. rst-class:: classref-item-separator ---- .. _class_StyleBoxTexture_method_set_expand_margin_all: .. rst-class:: classref-method |void| **set_expand_margin_all**\ (\ size\: :ref:`float`\ ) :ref:`🔗` Imposta il margine di espansione a ``size`` pixel per tutti i lati. .. rst-class:: classref-item-separator ---- .. _class_StyleBoxTexture_method_set_texture_margin: .. rst-class:: classref-method |void| **set_texture_margin**\ (\ margin\: :ref:`Side`, size\: :ref:`float`\ ) :ref:`🔗` Imposta il margine a ``size`` pixel per il lato specificato come :ref:`Side`. .. rst-class:: classref-item-separator ---- .. _class_StyleBoxTexture_method_set_texture_margin_all: .. rst-class:: classref-method |void| **set_texture_margin_all**\ (\ size\: :ref:`float`\ ) :ref:`🔗` Imposta il margine su ``size`` pixel per tutti i lati. .. |virtual| replace:: :abbr:`virtual (Questo metodo dovrebbe solitamente essere sovrascritto dall'utente per aver un effetto.)` .. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)` .. |const| replace:: :abbr:`const (Questo metodo non ha effetti collaterali. Non modifica alcuna variabile appartenente all'istanza.)` .. |vararg| replace:: :abbr:`vararg (Questo metodo accetta qualsiasi numero di argomenti oltre a quelli descritti qui.)` .. |constructor| replace:: :abbr:`constructor (Questo metodo è utilizzato per creare un tipo.)` .. |static| replace:: :abbr:`static (Questo metodo non necessita di alcun'istanza per essere chiamato, quindi può essere chiamato direttamente usando il nome della classe.)` .. |operator| replace:: :abbr:`operator (Questo metodo descrive un operatore valido da usare con questo tipo come operando di sinistra.)` .. |bitfield| replace:: :abbr:`BitField (Questo valore è un intero composto da una maschera di bit dei seguenti flag.)` .. |void| replace:: :abbr:`void (Nessun valore restituito.)`