class_gradient.rst 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the Gradient.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_Gradient:
  5. Gradient
  6. ========
  7. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
  8. **Category:** Core
  9. Brief Description
  10. -----------------
  11. Color interpolator node.
  12. Properties
  13. ----------
  14. +---------------------------------------------+----------------------------------------+
  15. | :ref:`PoolColorArray<class_PoolColorArray>` | :ref:`colors<class_Gradient_colors>` |
  16. +---------------------------------------------+----------------------------------------+
  17. | :ref:`PoolRealArray<class_PoolRealArray>` | :ref:`offsets<class_Gradient_offsets>` |
  18. +---------------------------------------------+----------------------------------------+
  19. Methods
  20. -------
  21. +----------------------------+--------------------------------------------------------------------------------------------------------------------------+
  22. | void | :ref:`add_point<class_Gradient_add_point>` **(** :ref:`float<class_float>` offset, :ref:`Color<class_Color>` color **)** |
  23. +----------------------------+--------------------------------------------------------------------------------------------------------------------------+
  24. | :ref:`Color<class_Color>` | :ref:`get_color<class_Gradient_get_color>` **(** :ref:`int<class_int>` point **)** const |
  25. +----------------------------+--------------------------------------------------------------------------------------------------------------------------+
  26. | :ref:`float<class_float>` | :ref:`get_offset<class_Gradient_get_offset>` **(** :ref:`int<class_int>` point **)** const |
  27. +----------------------------+--------------------------------------------------------------------------------------------------------------------------+
  28. | :ref:`int<class_int>` | :ref:`get_point_count<class_Gradient_get_point_count>` **(** **)** const |
  29. +----------------------------+--------------------------------------------------------------------------------------------------------------------------+
  30. | :ref:`Color<class_Color>` | :ref:`interpolate<class_Gradient_interpolate>` **(** :ref:`float<class_float>` offset **)** |
  31. +----------------------------+--------------------------------------------------------------------------------------------------------------------------+
  32. | void | :ref:`remove_point<class_Gradient_remove_point>` **(** :ref:`int<class_int>` offset **)** |
  33. +----------------------------+--------------------------------------------------------------------------------------------------------------------------+
  34. | void | :ref:`set_color<class_Gradient_set_color>` **(** :ref:`int<class_int>` point, :ref:`Color<class_Color>` color **)** |
  35. +----------------------------+--------------------------------------------------------------------------------------------------------------------------+
  36. | void | :ref:`set_offset<class_Gradient_set_offset>` **(** :ref:`int<class_int>` point, :ref:`float<class_float>` offset **)** |
  37. +----------------------------+--------------------------------------------------------------------------------------------------------------------------+
  38. Description
  39. -----------
  40. Given a set of colors, this node will interpolate them in order, meaning, that if you have color 1, color 2 and color 3, the ramp will interpolate (generate the colors between two colors) from color 1 to color 2 and from color 2 to color 3. Initially the ramp will have 2 colors (black and white), one (black) at ramp lower offset 0 and the other (white) at the ramp higher offset 1.
  41. Property Descriptions
  42. ---------------------
  43. .. _class_Gradient_colors:
  44. - :ref:`PoolColorArray<class_PoolColorArray>` **colors**
  45. +----------+-------------------+
  46. | *Setter* | set_colors(value) |
  47. +----------+-------------------+
  48. | *Getter* | get_colors() |
  49. +----------+-------------------+
  50. Gradient's colors returned as a :ref:`PoolColorArray<class_PoolColorArray>`.
  51. .. _class_Gradient_offsets:
  52. - :ref:`PoolRealArray<class_PoolRealArray>` **offsets**
  53. +----------+--------------------+
  54. | *Setter* | set_offsets(value) |
  55. +----------+--------------------+
  56. | *Getter* | get_offsets() |
  57. +----------+--------------------+
  58. Gradient's offsets returned as a :ref:`PoolRealArray<class_PoolRealArray>`.
  59. Method Descriptions
  60. -------------------
  61. .. _class_Gradient_add_point:
  62. - void **add_point** **(** :ref:`float<class_float>` offset, :ref:`Color<class_Color>` color **)**
  63. Adds the specified color to the end of the ramp, with the specified offset
  64. .. _class_Gradient_get_color:
  65. - :ref:`Color<class_Color>` **get_color** **(** :ref:`int<class_int>` point **)** const
  66. Returns the color of the ramp color at index *point*
  67. .. _class_Gradient_get_offset:
  68. - :ref:`float<class_float>` **get_offset** **(** :ref:`int<class_int>` point **)** const
  69. Returns the offset of the ramp color at index *point*
  70. .. _class_Gradient_get_point_count:
  71. - :ref:`int<class_int>` **get_point_count** **(** **)** const
  72. Returns the number of colors in the ramp
  73. .. _class_Gradient_interpolate:
  74. - :ref:`Color<class_Color>` **interpolate** **(** :ref:`float<class_float>` offset **)**
  75. Returns the interpolated color specified by *offset*
  76. .. _class_Gradient_remove_point:
  77. - void **remove_point** **(** :ref:`int<class_int>` offset **)**
  78. Removes the color at the index *offset*
  79. .. _class_Gradient_set_color:
  80. - void **set_color** **(** :ref:`int<class_int>` point, :ref:`Color<class_Color>` color **)**
  81. Sets the color of the ramp color at index *point*
  82. .. _class_Gradient_set_offset:
  83. - void **set_offset** **(** :ref:`int<class_int>` point, :ref:`float<class_float>` offset **)**
  84. Sets the offset for the ramp color at index *point*