mirror of
https://github.com/stan220/godot-docs.git
synced 2026-09-08 18:29:11 +00:00
classref: Sync with latest 4.0-dev
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
:github_url: hide
|
||||
|
||||
.. Generated automatically by doc/tools/makerst.py in Godot's source tree.
|
||||
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||||
.. DO NOT EDIT THIS FILE, but the Gradient.xml source instead.
|
||||
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||||
|
||||
@@ -21,11 +21,13 @@ Given a set of colors, this resource will interpolate them in order. This means
|
||||
Properties
|
||||
----------
|
||||
|
||||
+-----------------------------------------------------+-------------------------------------------------+----------------------------------------------+
|
||||
| :ref:`PackedColorArray<class_PackedColorArray>` | :ref:`colors<class_Gradient_property_colors>` | ``PackedColorArray(0, 0, 0, 1, 1, 1, 1, 1)`` |
|
||||
+-----------------------------------------------------+-------------------------------------------------+----------------------------------------------+
|
||||
| :ref:`PackedFloat32Array<class_PackedFloat32Array>` | :ref:`offsets<class_Gradient_property_offsets>` | ``PackedFloat32Array(0, 1)`` |
|
||||
+-----------------------------------------------------+-------------------------------------------------+----------------------------------------------+
|
||||
+-----------------------------------------------------------+-----------------------------------------------------------------------+----------------------------------------------+
|
||||
| :ref:`PackedColorArray<class_PackedColorArray>` | :ref:`colors<class_Gradient_property_colors>` | ``PackedColorArray(0, 0, 0, 1, 1, 1, 1, 1)`` |
|
||||
+-----------------------------------------------------------+-----------------------------------------------------------------------+----------------------------------------------+
|
||||
| :ref:`InterpolationMode<enum_Gradient_InterpolationMode>` | :ref:`interpolation_mode<class_Gradient_property_interpolation_mode>` | ``0`` |
|
||||
+-----------------------------------------------------------+-----------------------------------------------------------------------+----------------------------------------------+
|
||||
| :ref:`PackedFloat32Array<class_PackedFloat32Array>` | :ref:`offsets<class_Gradient_property_offsets>` | ``PackedFloat32Array(0, 1)`` |
|
||||
+-----------------------------------------------------------+-----------------------------------------------------------------------+----------------------------------------------+
|
||||
|
||||
Methods
|
||||
-------
|
||||
@@ -43,11 +45,32 @@ Methods
|
||||
+---------------------------+---------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`remove_point<class_Gradient_method_remove_point>` **(** :ref:`int<class_int>` point **)** |
|
||||
+---------------------------+---------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`reverse<class_Gradient_method_reverse>` **(** **)** |
|
||||
+---------------------------+---------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`set_color<class_Gradient_method_set_color>` **(** :ref:`int<class_int>` point, :ref:`Color<class_Color>` color **)** |
|
||||
+---------------------------+---------------------------------------------------------------------------------------------------------------------------------+
|
||||
| void | :ref:`set_offset<class_Gradient_method_set_offset>` **(** :ref:`int<class_int>` point, :ref:`float<class_float>` offset **)** |
|
||||
+---------------------------+---------------------------------------------------------------------------------------------------------------------------------+
|
||||
|
||||
Enumerations
|
||||
------------
|
||||
|
||||
.. _enum_Gradient_InterpolationMode:
|
||||
|
||||
.. _class_Gradient_constant_GRADIENT_INTERPOLATE_LINEAR:
|
||||
|
||||
.. _class_Gradient_constant_GRADIENT_INTERPOLATE_CONSTANT:
|
||||
|
||||
.. _class_Gradient_constant_GRADIENT_INTERPOLATE_CUBIC:
|
||||
|
||||
enum **InterpolationMode**:
|
||||
|
||||
- **GRADIENT_INTERPOLATE_LINEAR** = **0** --- Linear interpolation.
|
||||
|
||||
- **GRADIENT_INTERPOLATE_CONSTANT** = **1** --- Constant interpolation, color changes abruptly at each point and stays uniform between. This might cause visible aliasing when used for a gradient texture in some cases.
|
||||
|
||||
- **GRADIENT_INTERPOLATE_CUBIC** = **2** --- Cubic interpolation.
|
||||
|
||||
Property Descriptions
|
||||
---------------------
|
||||
|
||||
@@ -67,6 +90,22 @@ Gradient's colors returned as a :ref:`PackedColorArray<class_PackedColorArray>`.
|
||||
|
||||
----
|
||||
|
||||
.. _class_Gradient_property_interpolation_mode:
|
||||
|
||||
- :ref:`InterpolationMode<enum_Gradient_InterpolationMode>` **interpolation_mode**
|
||||
|
||||
+-----------+-------------------------------+
|
||||
| *Default* | ``0`` |
|
||||
+-----------+-------------------------------+
|
||||
| *Setter* | set_interpolation_mode(value) |
|
||||
+-----------+-------------------------------+
|
||||
| *Getter* | get_interpolation_mode() |
|
||||
+-----------+-------------------------------+
|
||||
|
||||
Defines how the colors between points of the gradient are interpolated. See :ref:`InterpolationMode<enum_Gradient_InterpolationMode>` for available modes.
|
||||
|
||||
----
|
||||
|
||||
.. _class_Gradient_property_offsets:
|
||||
|
||||
- :ref:`PackedFloat32Array<class_PackedFloat32Array>` **offsets**
|
||||
@@ -132,6 +171,14 @@ Removes the color at the index ``point``.
|
||||
|
||||
----
|
||||
|
||||
.. _class_Gradient_method_reverse:
|
||||
|
||||
- void **reverse** **(** **)**
|
||||
|
||||
Reverses/mirrors the gradient.
|
||||
|
||||
----
|
||||
|
||||
.. _class_Gradient_method_set_color:
|
||||
|
||||
- void **set_color** **(** :ref:`int<class_int>` point, :ref:`Color<class_Color>` color **)**
|
||||
|
||||
Reference in New Issue
Block a user