class_gradient.rst 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the Gradient.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_Gradient:
  6. Gradient
  7. ========
  8. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
  9. **Category:** Core
  10. Brief Description
  11. -----------------
  12. Color interpolator node.
  13. Properties
  14. ----------
  15. +---------------------------------------------+-------------------------------------------------+
  16. | :ref:`PoolColorArray<class_PoolColorArray>` | :ref:`colors<class_Gradient_property_colors>` |
  17. +---------------------------------------------+-------------------------------------------------+
  18. | :ref:`PoolRealArray<class_PoolRealArray>` | :ref:`offsets<class_Gradient_property_offsets>` |
  19. +---------------------------------------------+-------------------------------------------------+
  20. Methods
  21. -------
  22. +---------------------------+---------------------------------------------------------------------------------------------------------------------------------+
  23. | void | :ref:`add_point<class_Gradient_method_add_point>` **(** :ref:`float<class_float>` offset, :ref:`Color<class_Color>` color **)** |
  24. +---------------------------+---------------------------------------------------------------------------------------------------------------------------------+
  25. | :ref:`Color<class_Color>` | :ref:`get_color<class_Gradient_method_get_color>` **(** :ref:`int<class_int>` point **)** const |
  26. +---------------------------+---------------------------------------------------------------------------------------------------------------------------------+
  27. | :ref:`float<class_float>` | :ref:`get_offset<class_Gradient_method_get_offset>` **(** :ref:`int<class_int>` point **)** const |
  28. +---------------------------+---------------------------------------------------------------------------------------------------------------------------------+
  29. | :ref:`int<class_int>` | :ref:`get_point_count<class_Gradient_method_get_point_count>` **(** **)** const |
  30. +---------------------------+---------------------------------------------------------------------------------------------------------------------------------+
  31. | :ref:`Color<class_Color>` | :ref:`interpolate<class_Gradient_method_interpolate>` **(** :ref:`float<class_float>` offset **)** |
  32. +---------------------------+---------------------------------------------------------------------------------------------------------------------------------+
  33. | void | :ref:`remove_point<class_Gradient_method_remove_point>` **(** :ref:`int<class_int>` offset **)** |
  34. +---------------------------+---------------------------------------------------------------------------------------------------------------------------------+
  35. | void | :ref:`set_color<class_Gradient_method_set_color>` **(** :ref:`int<class_int>` point, :ref:`Color<class_Color>` color **)** |
  36. +---------------------------+---------------------------------------------------------------------------------------------------------------------------------+
  37. | void | :ref:`set_offset<class_Gradient_method_set_offset>` **(** :ref:`int<class_int>` point, :ref:`float<class_float>` offset **)** |
  38. +---------------------------+---------------------------------------------------------------------------------------------------------------------------------+
  39. Description
  40. -----------
  41. 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.
  42. Property Descriptions
  43. ---------------------
  44. .. _class_Gradient_property_colors:
  45. - :ref:`PoolColorArray<class_PoolColorArray>` **colors**
  46. +----------+-------------------+
  47. | *Setter* | set_colors(value) |
  48. +----------+-------------------+
  49. | *Getter* | get_colors() |
  50. +----------+-------------------+
  51. Gradient's colors returned as a :ref:`PoolColorArray<class_PoolColorArray>`.
  52. ----
  53. .. _class_Gradient_property_offsets:
  54. - :ref:`PoolRealArray<class_PoolRealArray>` **offsets**
  55. +----------+--------------------+
  56. | *Setter* | set_offsets(value) |
  57. +----------+--------------------+
  58. | *Getter* | get_offsets() |
  59. +----------+--------------------+
  60. Gradient's offsets returned as a :ref:`PoolRealArray<class_PoolRealArray>`.
  61. Method Descriptions
  62. -------------------
  63. .. _class_Gradient_method_add_point:
  64. - void **add_point** **(** :ref:`float<class_float>` offset, :ref:`Color<class_Color>` color **)**
  65. Adds the specified color to the end of the ramp, with the specified offset
  66. ----
  67. .. _class_Gradient_method_get_color:
  68. - :ref:`Color<class_Color>` **get_color** **(** :ref:`int<class_int>` point **)** const
  69. Returns the color of the ramp color at index *point*
  70. ----
  71. .. _class_Gradient_method_get_offset:
  72. - :ref:`float<class_float>` **get_offset** **(** :ref:`int<class_int>` point **)** const
  73. Returns the offset of the ramp color at index *point*
  74. ----
  75. .. _class_Gradient_method_get_point_count:
  76. - :ref:`int<class_int>` **get_point_count** **(** **)** const
  77. Returns the number of colors in the ramp
  78. ----
  79. .. _class_Gradient_method_interpolate:
  80. - :ref:`Color<class_Color>` **interpolate** **(** :ref:`float<class_float>` offset **)**
  81. Returns the interpolated color specified by *offset*
  82. ----
  83. .. _class_Gradient_method_remove_point:
  84. - void **remove_point** **(** :ref:`int<class_int>` offset **)**
  85. Removes the color at the index *offset*
  86. ----
  87. .. _class_Gradient_method_set_color:
  88. - void **set_color** **(** :ref:`int<class_int>` point, :ref:`Color<class_Color>` color **)**
  89. Sets the color of the ramp color at index *point*
  90. ----
  91. .. _class_Gradient_method_set_offset:
  92. - void **set_offset** **(** :ref:`int<class_int>` point, :ref:`float<class_float>` offset **)**
  93. Sets the offset for the ramp color at index *point*