mirror of
https://github.com/godotengine/godot-docs-l10n.git
synced 2026-01-04 10:09:56 +03:00
Currently including `zh_CN` and `es` which both have very high completion ratios. Others will be added once they reach a significant percentage too. These RST files will be used by godot-docs in place of its `classes` folder after we sync with https://github.com/godotengine/godot-docs/pull/5458. The update workflow is manual for now (example for `zh_CN`): - Build `godotengine/godot` in the branch we currently track (now `3.x`) - Run `godot --doctool -l zh_CN` - Run `cd doc && make rst LANGARG=zh_CN` - Copy `doc/_build/rst/*` to `classes/zh_CN/` here - Make sure to have `classes/zh_CN/index.rst` copied from `docs/classes`
152 lines
7.4 KiB
ReStructuredText
152 lines
7.4 KiB
ReStructuredText
:github_url: hide
|
|
|
|
.. 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.
|
|
|
|
.. _class_Gradient:
|
|
|
|
Gradient
|
|
========
|
|
|
|
**Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
|
|
|
|
Un recurso interpolador de color que puede ser usado para generar colores entre puntos de color definidos por el usuario.
|
|
|
|
Descripción
|
|
----------------------
|
|
|
|
Dado un conjunto de colores, este recurso los interpolará en orden. Esto significa que si tiene el color 1, el color 2 y el color 3, la rampa interpolará del color 1 al color 2 y del color 2 al color 3. La rampa tendrá inicialmente 2 colores (blanco y negro), uno (negro) en la rampa de menor desplazamiento 0 y el otro (blanco) en la rampa de mayor desplazamiento 1.
|
|
|
|
Propiedades
|
|
----------------------
|
|
|
|
+---------------------------------------------+-------------------------------------------------+----------------------------------------------+
|
|
| :ref:`PoolColorArray<class_PoolColorArray>` | :ref:`colors<class_Gradient_property_colors>` | ``PoolColorArray( 0, 0, 0, 1, 1, 1, 1, 1 )`` |
|
|
+---------------------------------------------+-------------------------------------------------+----------------------------------------------+
|
|
| :ref:`PoolRealArray<class_PoolRealArray>` | :ref:`offsets<class_Gradient_property_offsets>` | ``PoolRealArray( 0, 1 )`` |
|
|
+---------------------------------------------+-------------------------------------------------+----------------------------------------------+
|
|
|
|
Métodos
|
|
--------------
|
|
|
|
+---------------------------+---------------------------------------------------------------------------------------------------------------------------------+
|
|
| 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 **)** |
|
|
+---------------------------+---------------------------------------------------------------------------------------------------------------------------------+
|
|
| :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:`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>` point **)** |
|
|
+---------------------------+---------------------------------------------------------------------------------------------------------------------------------+
|
|
| 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 **)** |
|
|
+---------------------------+---------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
Descripciones de Propiedades
|
|
--------------------------------------------------------
|
|
|
|
.. _class_Gradient_property_colors:
|
|
|
|
- :ref:`PoolColorArray<class_PoolColorArray>` **colors**
|
|
|
|
+-----------+----------------------------------------------+
|
|
| *Default* | ``PoolColorArray( 0, 0, 0, 1, 1, 1, 1, 1 )`` |
|
|
+-----------+----------------------------------------------+
|
|
| *Setter* | set_colors(value) |
|
|
+-----------+----------------------------------------------+
|
|
| *Getter* | get_colors() |
|
|
+-----------+----------------------------------------------+
|
|
|
|
Gradient's colors returned as a :ref:`PoolColorArray<class_PoolColorArray>`.
|
|
|
|
----
|
|
|
|
.. _class_Gradient_property_offsets:
|
|
|
|
- :ref:`PoolRealArray<class_PoolRealArray>` **offsets**
|
|
|
|
+-----------+---------------------------+
|
|
| *Default* | ``PoolRealArray( 0, 1 )`` |
|
|
+-----------+---------------------------+
|
|
| *Setter* | set_offsets(value) |
|
|
+-----------+---------------------------+
|
|
| *Getter* | get_offsets() |
|
|
+-----------+---------------------------+
|
|
|
|
Gradient's offsets returned as a :ref:`PoolRealArray<class_PoolRealArray>`.
|
|
|
|
Descripciones de Métodos
|
|
------------------------------------------------
|
|
|
|
.. _class_Gradient_method_add_point:
|
|
|
|
- void **add_point** **(** :ref:`float<class_float>` offset, :ref:`Color<class_Color>` color **)**
|
|
|
|
Añade el color especificado al final de la rampa, con el desplazamiento especificado.
|
|
|
|
----
|
|
|
|
.. _class_Gradient_method_get_color:
|
|
|
|
- :ref:`Color<class_Color>` **get_color** **(** :ref:`int<class_int>` point **)**
|
|
|
|
Devuelve el color del color de la rampa en el índice ``point``.
|
|
|
|
----
|
|
|
|
.. _class_Gradient_method_get_offset:
|
|
|
|
- :ref:`float<class_float>` **get_offset** **(** :ref:`int<class_int>` point **)**
|
|
|
|
Devuelve el color del color de la rampa en el índice ``point``.
|
|
|
|
----
|
|
|
|
.. _class_Gradient_method_get_point_count:
|
|
|
|
- :ref:`int<class_int>` **get_point_count** **(** **)** |const|
|
|
|
|
Devuelve el número de colores de la rampa.
|
|
|
|
----
|
|
|
|
.. _class_Gradient_method_interpolate:
|
|
|
|
- :ref:`Color<class_Color>` **interpolate** **(** :ref:`float<class_float>` offset **)**
|
|
|
|
Devuelve el color interpolado especificado por ``offset``.
|
|
|
|
----
|
|
|
|
.. _class_Gradient_method_remove_point:
|
|
|
|
- void **remove_point** **(** :ref:`int<class_int>` point **)**
|
|
|
|
Removes the color at the index ``point``.
|
|
|
|
----
|
|
|
|
.. _class_Gradient_method_set_color:
|
|
|
|
- void **set_color** **(** :ref:`int<class_int>` point, :ref:`Color<class_Color>` color **)**
|
|
|
|
Establece el color del color de la rampa en el índice ``point``.
|
|
|
|
----
|
|
|
|
.. _class_Gradient_method_set_offset:
|
|
|
|
- void **set_offset** **(** :ref:`int<class_int>` point, :ref:`float<class_float>` offset **)**
|
|
|
|
Establece el desplazamiento del color de la rampa en el índice ``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.)`
|