classref: Sync with latest 4.0-dev

This commit is contained in:
Rémi Verschelde
2021-10-05 16:09:21 +02:00
parent 6952796767
commit f6f6c1bf19
958 changed files with 113054 additions and 52009 deletions

View File

@@ -9,23 +9,23 @@
Gradient
========
**Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
**Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
A color interpolator resource which can be used to generate colors between user-defined color points.
Description
-----------
Given a set of colors, this resource will interpolate them in order. This means that if you have color 1, color 2 and color 3, the ramp will interpolate from color 1 to color 2 and from color 2 to color 3. The ramp will initially have 2 colors (black and white), one (black) at ramp lower offset 0 and the other (white) at the ramp higher offset 1.
Given a set of colors, this resource will interpolate them in order. This means that if you have color 1, color 2 and color 3, the gradient will interpolate from color 1 to color 2 and from color 2 to color 3. The gradient will initially have 2 colors (black and white), one (black) at gradient lower offset 0 and the other (white) at the gradient higher offset 1.
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:`PackedFloat32Array<class_PackedFloat32Array>` | :ref:`offsets<class_Gradient_property_offsets>` | ``PackedFloat32Array(0, 1)`` |
+-----------------------------------------------------+-------------------------------------------------+----------------------------------------------+
Methods
-------
@@ -33,15 +33,15 @@ Methods
+---------------------------+---------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`add_point<class_Gradient_method_add_point>` **(** :ref:`float<class_float>` offset, :ref:`Color<class_Color>` color **)** |
+---------------------------+---------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Color<class_Color>` | :ref:`get_color<class_Gradient_method_get_color>` **(** :ref:`int<class_int>` point **)** const |
| :ref:`Color<class_Color>` | :ref:`get_color<class_Gradient_method_get_color>` **(** :ref:`int<class_int>` point **)** |
+---------------------------+---------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_offset<class_Gradient_method_get_offset>` **(** :ref:`int<class_int>` point **)** const |
| :ref:`float<class_float>` | :ref:`get_offset<class_Gradient_method_get_offset>` **(** :ref:`int<class_int>` point **)** |
+---------------------------+---------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_point_count<class_Gradient_method_get_point_count>` **(** **)** const |
| :ref:`int<class_int>` | :ref:`get_point_count<class_Gradient_method_get_point_count>` **(** **)** |const| |
+---------------------------+---------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Color<class_Color>` | :ref:`interpolate<class_Gradient_method_interpolate>` **(** :ref:`float<class_float>` offset **)** |
+---------------------------+---------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`remove_point<class_Gradient_method_remove_point>` **(** :ref:`int<class_int>` offset **)** |
| void | :ref:`remove_point<class_Gradient_method_remove_point>` **(** :ref:`int<class_int>` point **)** |
+---------------------------+---------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_color<class_Gradient_method_set_color>` **(** :ref:`int<class_int>` point, :ref:`Color<class_Color>` color **)** |
+---------------------------+---------------------------------------------------------------------------------------------------------------------------------+
@@ -55,13 +55,13 @@ Property Descriptions
- :ref:`PackedColorArray<class_PackedColorArray>` **colors**
+-----------+------------------------------------------------+
| *Default* | ``PackedColorArray( 0, 0, 0, 1, 1, 1, 1, 1 )`` |
+-----------+------------------------------------------------+
| *Setter* | set_colors(value) |
+-----------+------------------------------------------------+
| *Getter* | get_colors() |
+-----------+------------------------------------------------+
+-----------+----------------------------------------------+
| *Default* | ``PackedColorArray(0, 0, 0, 1, 1, 1, 1, 1)`` |
+-----------+----------------------------------------------+
| *Setter* | set_colors(value) |
+-----------+----------------------------------------------+
| *Getter* | get_colors() |
+-----------+----------------------------------------------+
Gradient's colors returned as a :ref:`PackedColorArray<class_PackedColorArray>`.
@@ -71,13 +71,13 @@ Gradient's colors returned as a :ref:`PackedColorArray<class_PackedColorArray>`.
- :ref:`PackedFloat32Array<class_PackedFloat32Array>` **offsets**
+-----------+--------------------------------+
| *Default* | ``PackedFloat32Array( 0, 1 )`` |
+-----------+--------------------------------+
| *Setter* | set_offsets(value) |
+-----------+--------------------------------+
| *Getter* | get_offsets() |
+-----------+--------------------------------+
+-----------+------------------------------+
| *Default* | ``PackedFloat32Array(0, 1)`` |
+-----------+------------------------------+
| *Setter* | set_offsets(value) |
+-----------+------------------------------+
| *Getter* | get_offsets() |
+-----------+------------------------------+
Gradient's offsets returned as a :ref:`PackedFloat32Array<class_PackedFloat32Array>`.
@@ -88,31 +88,31 @@ Method Descriptions
- void **add_point** **(** :ref:`float<class_float>` offset, :ref:`Color<class_Color>` color **)**
Adds the specified color to the end of the ramp, with the specified offset.
Adds the specified color to the end of the gradient, with the specified offset.
----
.. _class_Gradient_method_get_color:
- :ref:`Color<class_Color>` **get_color** **(** :ref:`int<class_int>` point **)** const
- :ref:`Color<class_Color>` **get_color** **(** :ref:`int<class_int>` point **)**
Returns the color of the ramp color at index ``point``.
Returns the color of the gradient color at index ``point``.
----
.. _class_Gradient_method_get_offset:
- :ref:`float<class_float>` **get_offset** **(** :ref:`int<class_int>` point **)** const
- :ref:`float<class_float>` **get_offset** **(** :ref:`int<class_int>` point **)**
Returns the offset of the ramp color at index ``point``.
Returns the offset of the gradient color at index ``point``.
----
.. _class_Gradient_method_get_point_count:
- :ref:`int<class_int>` **get_point_count** **(** **)** const
- :ref:`int<class_int>` **get_point_count** **(** **)** |const|
Returns the number of colors in the ramp.
Returns the number of colors in the gradient.
----
@@ -126,9 +126,9 @@ Returns the interpolated color specified by ``offset``.
.. _class_Gradient_method_remove_point:
- void **remove_point** **(** :ref:`int<class_int>` offset **)**
- void **remove_point** **(** :ref:`int<class_int>` point **)**
Removes the color at the index ``offset``.
Removes the color at the index ``point``.
----
@@ -136,7 +136,7 @@ Removes the color at the index ``offset``.
- void **set_color** **(** :ref:`int<class_int>` point, :ref:`Color<class_Color>` color **)**
Sets the color of the ramp color at index ``point``.
Sets the color of the gradient color at index ``point``.
----
@@ -144,5 +144,11 @@ Sets the color of the ramp color at index ``point``.
- void **set_offset** **(** :ref:`int<class_int>` point, :ref:`float<class_float>` offset **)**
Sets the offset for the ramp color at index ``point``.
Sets the offset for the gradient color at index ``point``.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`