mirror of
https://github.com/godotengine/godot-docs-l10n.git
synced 2025-12-31 09:49:22 +03:00
102 lines
5.3 KiB
ReStructuredText
102 lines
5.3 KiB
ReStructuredText
:github_url: hide
|
|
|
|
.. _class_GradientTexture1D:
|
|
|
|
GradientTexture1D
|
|
=================
|
|
|
|
**繼承:** :ref:`Texture2D<class_Texture2D>` **<** :ref:`Texture<class_Texture>` **<** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
|
|
|
|
使用從 :ref:`Gradient<class_Gradient>` 獲得的顏色的 1D 紋理。
|
|
|
|
.. rst-class:: classref-introduction-group
|
|
|
|
說明
|
|
----
|
|
|
|
GradientTexture1D 使用一個 :ref:`Gradient<class_Gradient>` 來填充紋理資料。該漸變紋理將使用從漸變中獲得的顏色從左到右進行填充。這意味著該紋理不一定代表漸變的精確副本,而是以固定步長從漸變中獲得的樣本的插值(見 :ref:`width<class_GradientTexture1D_property_width>`\ )。另見 :ref:`GradientTexture2D<class_GradientTexture2D>`\ 、\ :ref:`CurveTexture<class_CurveTexture>` 和 :ref:`CurveXYZTexture<class_CurveXYZTexture>`\ 。
|
|
|
|
.. rst-class:: classref-reftable-group
|
|
|
|
屬性
|
|
----
|
|
|
|
.. table::
|
|
:widths: auto
|
|
|
|
+---------------------------------+------------------------------------------------------------+----------------------------------------------------------------------------------------+
|
|
| :ref:`Gradient<class_Gradient>` | :ref:`gradient<class_GradientTexture1D_property_gradient>` | |
|
|
+---------------------------------+------------------------------------------------------------+----------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | resource_local_to_scene | ``false`` (overrides :ref:`Resource<class_Resource_property_resource_local_to_scene>`) |
|
|
+---------------------------------+------------------------------------------------------------+----------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`use_hdr<class_GradientTexture1D_property_use_hdr>` | ``false`` |
|
|
+---------------------------------+------------------------------------------------------------+----------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`width<class_GradientTexture1D_property_width>` | ``256`` |
|
|
+---------------------------------+------------------------------------------------------------+----------------------------------------------------------------------------------------+
|
|
|
|
.. rst-class:: classref-section-separator
|
|
|
|
----
|
|
|
|
.. rst-class:: classref-descriptions-group
|
|
|
|
屬性說明
|
|
--------
|
|
|
|
.. _class_GradientTexture1D_property_gradient:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`Gradient<class_Gradient>` **gradient** :ref:`🔗<class_GradientTexture1D_property_gradient>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_gradient**\ (\ value\: :ref:`Gradient<class_Gradient>`\ )
|
|
- :ref:`Gradient<class_Gradient>` **get_gradient**\ (\ )
|
|
|
|
用於填充紋理的 :ref:`Gradient<class_Gradient>`\ 。
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_GradientTexture1D_property_use_hdr:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`bool<class_bool>` **use_hdr** = ``false`` :ref:`🔗<class_GradientTexture1D_property_use_hdr>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_use_hdr**\ (\ value\: :ref:`bool<class_bool>`\ )
|
|
- :ref:`bool<class_bool>` **is_using_hdr**\ (\ )
|
|
|
|
如果為 ``true``\ ,則生成的紋理會支援高動態範圍(\ :ref:`Image.FORMAT_RGBAF<class_Image_constant_FORMAT_RGBAF>` 格式)。可以在 :ref:`Environment.glow_enabled<class_Environment_property_glow_enabled>` 為 ``true`` 時實作輝光效果。如果為 ``false``\ ,則生成的紋理會使用低動態範圍;過亮的顏色會被鉗制(\ :ref:`Image.FORMAT_RGBA8<class_Image_constant_FORMAT_RGBA8>` 格式)。
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_GradientTexture1D_property_width:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`int<class_int>` **width** = ``256`` :ref:`🔗<class_GradientTexture1D_property_width>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_width**\ (\ value\: :ref:`int<class_int>`\ )
|
|
- :ref:`int<class_int>` **get_width**\ (\ )
|
|
|
|
將從 :ref:`Gradient<class_Gradient>` 中獲得的顏色樣本的數量。
|
|
|
|
.. |virtual| replace:: :abbr:`virtual (本方法通常需要使用者覆寫才能生效。)`
|
|
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
|
.. |const| replace:: :abbr:`const (本方法沒有副作用。不會修改該實例的任何成員變數。)`
|
|
.. |vararg| replace:: :abbr:`vararg (本方法除了這裡描述的參數外,還可以接受任意數量的參數。)`
|
|
.. |constructor| replace:: :abbr:`constructor (本方法用於建構一個型別。)`
|
|
.. |static| replace:: :abbr:`static (本方法無需實例即可呼叫,因此可以直接使用類別名稱呼叫。)`
|
|
.. |operator| replace:: :abbr:`operator (本方法描述將本型別作為左運算元時可用的有效運算子。)`
|
|
.. |bitfield| replace:: :abbr:`BitField (此值是由下列旗標組成的位元遮罩整數。)`
|
|
.. |void| replace:: :abbr:`void (無回傳值。)`
|