:github_url: hide .. _class_GradientTexture2D: GradientTexture2D ================= **Eredita:** :ref:`Texture2D` **<** :ref:`Texture` **<** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` Una texture 2D che crea un motivo con colori ottenuti da un :ref:`Gradient`. .. rst-class:: classref-introduction-group Descrizione ---------------------- Una texture 2D che ottiene colori da un :ref:`Gradient` per riempire i dati della texture. Questa texture è in grado di trasformare una transizione di colore in diversi motivi, come un gradiente lineare o radiale. Come predefinito, la texture è riempita interpolando i colori a partire dagli offset :ref:`fill_from` a :ref:`fill_to`, ma il riempimento del gradiente si può ripetere per coprire l'intera texture. Il gradiente è campionato individualmente per ogni pixel, quindi non rappresenta necessariamente una copia esatta del gradiente (vedi :ref:`width` e :ref:`height`). Vedi anche :ref:`GradientTexture1D`, :ref:`CurveTexture` e :ref:`CurveXYZTexture`. .. rst-class:: classref-reftable-group Proprietà ------------------ .. table:: :widths: auto +----------------------------------------------+--------------------------------------------------------------+----------------------------------------------------------------------------------------+ | :ref:`Fill` | :ref:`fill` | ``0`` | +----------------------------------------------+--------------------------------------------------------------+----------------------------------------------------------------------------------------+ | :ref:`Vector2` | :ref:`fill_from` | ``Vector2(0, 0)`` | +----------------------------------------------+--------------------------------------------------------------+----------------------------------------------------------------------------------------+ | :ref:`Vector2` | :ref:`fill_to` | ``Vector2(1, 0)`` | +----------------------------------------------+--------------------------------------------------------------+----------------------------------------------------------------------------------------+ | :ref:`Gradient` | :ref:`gradient` | | +----------------------------------------------+--------------------------------------------------------------+----------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`height` | ``64`` | +----------------------------------------------+--------------------------------------------------------------+----------------------------------------------------------------------------------------+ | :ref:`Repeat` | :ref:`repeat` | ``0`` | +----------------------------------------------+--------------------------------------------------------------+----------------------------------------------------------------------------------------+ | :ref:`bool` | resource_local_to_scene | ``false`` (overrides :ref:`Resource`) | +----------------------------------------------+--------------------------------------------------------------+----------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`use_hdr` | ``false`` | +----------------------------------------------+--------------------------------------------------------------+----------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`width` | ``64`` | +----------------------------------------------+--------------------------------------------------------------+----------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Enumerazioni ------------------------ .. _enum_GradientTexture2D_Fill: .. rst-class:: classref-enumeration enum **Fill**: :ref:`🔗` .. _class_GradientTexture2D_constant_FILL_LINEAR: .. rst-class:: classref-enumeration-constant :ref:`Fill` **FILL_LINEAR** = ``0`` I colori sono interpolati linearmente lungo una linea retta. .. _class_GradientTexture2D_constant_FILL_RADIAL: .. rst-class:: classref-enumeration-constant :ref:`Fill` **FILL_RADIAL** = ``1`` I colori sono interpolati linearmente in un motivo circolare. .. _class_GradientTexture2D_constant_FILL_SQUARE: .. rst-class:: classref-enumeration-constant :ref:`Fill` **FILL_SQUARE** = ``2`` I colori sono interpolati linearmente in un motivo quadrato. .. rst-class:: classref-item-separator ---- .. _enum_GradientTexture2D_Repeat: .. rst-class:: classref-enumeration enum **Repeat**: :ref:`🔗` .. _class_GradientTexture2D_constant_REPEAT_NONE: .. rst-class:: classref-enumeration-constant :ref:`Repeat` **REPEAT_NONE** = ``0`` Il riempimento del gradiente è limitato all'intervallo definito dagli offset :ref:`fill_from` e :ref:`fill_to`. .. _class_GradientTexture2D_constant_REPEAT: .. rst-class:: classref-enumeration-constant :ref:`Repeat` **REPEAT** = ``1`` La texture è riempita a partire dall'offset :ref:`fill_from` fino a :ref:`fill_to`, ripetendo lo stesso motivo in entrambe le direzioni. .. _class_GradientTexture2D_constant_REPEAT_MIRROR: .. rst-class:: classref-enumeration-constant :ref:`Repeat` **REPEAT_MIRROR** = ``2`` La texture è riempita a partire dall'offset :ref:`fill_from` fino a :ref:`fill_to`, rispecchiando il motivo in entrambe le direzioni. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Descrizioni delle proprietà ------------------------------------------------------ .. _class_GradientTexture2D_property_fill: .. rst-class:: classref-property :ref:`Fill` **fill** = ``0`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_fill**\ (\ value\: :ref:`Fill`\ ) - :ref:`Fill` **get_fill**\ (\ ) Il tipo di riempimento del gradiente. .. rst-class:: classref-item-separator ---- .. _class_GradientTexture2D_property_fill_from: .. rst-class:: classref-property :ref:`Vector2` **fill_from** = ``Vector2(0, 0)`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_fill_from**\ (\ value\: :ref:`Vector2`\ ) - :ref:`Vector2` **get_fill_from**\ (\ ) L'offset iniziale utilizzato per riempire la texture specificato nelle coordinate UV. .. rst-class:: classref-item-separator ---- .. _class_GradientTexture2D_property_fill_to: .. rst-class:: classref-property :ref:`Vector2` **fill_to** = ``Vector2(1, 0)`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_fill_to**\ (\ value\: :ref:`Vector2`\ ) - :ref:`Vector2` **get_fill_to**\ (\ ) L'offset finale utilizzato per riempire la texture specificato nelle coordinate UV. .. rst-class:: classref-item-separator ---- .. _class_GradientTexture2D_property_gradient: .. rst-class:: classref-property :ref:`Gradient` **gradient** :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_gradient**\ (\ value\: :ref:`Gradient`\ ) - :ref:`Gradient` **get_gradient**\ (\ ) Il :ref:`Gradient` usato per riempire la texture. .. rst-class:: classref-item-separator ---- .. _class_GradientTexture2D_property_height: .. rst-class:: classref-property :ref:`int` **height** = ``64`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_height**\ (\ value\: :ref:`int`\ ) - :ref:`int` **get_height**\ (\ ) Il numero di campioni di colore verticali che saranno ottenuti dal :ref:`Gradient`, che rappresenta anche l'altezza della texture. .. rst-class:: classref-item-separator ---- .. _class_GradientTexture2D_property_repeat: .. rst-class:: classref-property :ref:`Repeat` **repeat** = ``0`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_repeat**\ (\ value\: :ref:`Repeat`\ ) - :ref:`Repeat` **get_repeat**\ (\ ) Il tipo di ripetizione del gradiente. .. rst-class:: classref-item-separator ---- .. _class_GradientTexture2D_property_use_hdr: .. rst-class:: classref-property :ref:`bool` **use_hdr** = ``false`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_use_hdr**\ (\ value\: :ref:`bool`\ ) - :ref:`bool` **is_using_hdr**\ (\ ) Se ``true``, la texture generata supporterà un'ampia gamma dinamica (formato :ref:`Image.FORMAT_RGBAF`). Ciò consente agli effetti bagliore di funzionare se :ref:`Environment.glow_enabled` è ``true``. Se ``false``, la texture generata utilizzerà una bassa gamma dinamica; i colori sovra-luminosi saranno limitati (formato :ref:`Image.FORMAT_RGBA8`). .. rst-class:: classref-item-separator ---- .. _class_GradientTexture2D_property_width: .. rst-class:: classref-property :ref:`int` **width** = ``64`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_width**\ (\ value\: :ref:`int`\ ) - :ref:`int` **get_width**\ (\ ) Il numero di campioni di colore orizzontali che saranno ottenuti dal :ref:`Gradient`, che rappresenta anche la larghezza della texture. .. |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.)`