class_gradient.rst 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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. Member Functions
  13. ----------------
  14. +----------------------------+--------------------------------------------------------------------------------------------------------------------------+
  15. | void | :ref:`add_point<class_Gradient_add_point>` **(** :ref:`float<class_float>` offset, :ref:`Color<class_color>` color **)** |
  16. +----------------------------+--------------------------------------------------------------------------------------------------------------------------+
  17. | :ref:`Color<class_color>` | :ref:`get_color<class_Gradient_get_color>` **(** :ref:`int<class_int>` point **)** const |
  18. +----------------------------+--------------------------------------------------------------------------------------------------------------------------+
  19. | :ref:`float<class_float>` | :ref:`get_offset<class_Gradient_get_offset>` **(** :ref:`int<class_int>` point **)** const |
  20. +----------------------------+--------------------------------------------------------------------------------------------------------------------------+
  21. | :ref:`int<class_int>` | :ref:`get_point_count<class_Gradient_get_point_count>` **(** **)** const |
  22. +----------------------------+--------------------------------------------------------------------------------------------------------------------------+
  23. | :ref:`Color<class_color>` | :ref:`interpolate<class_Gradient_interpolate>` **(** :ref:`float<class_float>` offset **)** |
  24. +----------------------------+--------------------------------------------------------------------------------------------------------------------------+
  25. | void | :ref:`remove_point<class_Gradient_remove_point>` **(** :ref:`int<class_int>` offset **)** |
  26. +----------------------------+--------------------------------------------------------------------------------------------------------------------------+
  27. | void | :ref:`set_color<class_Gradient_set_color>` **(** :ref:`int<class_int>` point, :ref:`Color<class_color>` color **)** |
  28. +----------------------------+--------------------------------------------------------------------------------------------------------------------------+
  29. | void | :ref:`set_offset<class_Gradient_set_offset>` **(** :ref:`int<class_int>` point, :ref:`float<class_float>` offset **)** |
  30. +----------------------------+--------------------------------------------------------------------------------------------------------------------------+
  31. Member Variables
  32. ----------------
  33. .. _class_Gradient_colors:
  34. - :ref:`PoolColorArray<class_poolcolorarray>` **colors** - Gradient's colors returned as a :ref:`PoolColorArray<class_poolcolorarray>`.
  35. .. _class_Gradient_offsets:
  36. - :ref:`PoolRealArray<class_poolrealarray>` **offsets** - Gradient's offsets returned as a :ref:`PoolRealArray<class_poolrealarray>`.
  37. Description
  38. -----------
  39. Given a set of colors, this node will interpolate them in order, meaning, that if you have color 1, color 2 and color3, 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 offset 0 and the other (white) at the ramp higher offset 1.
  40. Member Function Description
  41. ---------------------------
  42. .. _class_Gradient_add_point:
  43. - void **add_point** **(** :ref:`float<class_float>` offset, :ref:`Color<class_color>` color **)**
  44. Adds the specified color to the end of the ramp, with the specified offset
  45. .. _class_Gradient_get_color:
  46. - :ref:`Color<class_color>` **get_color** **(** :ref:`int<class_int>` point **)** const
  47. Returns the color of the ramp color at index *point*
  48. .. _class_Gradient_get_offset:
  49. - :ref:`float<class_float>` **get_offset** **(** :ref:`int<class_int>` point **)** const
  50. Returns the offset of the ramp color at index *point*
  51. .. _class_Gradient_get_point_count:
  52. - :ref:`int<class_int>` **get_point_count** **(** **)** const
  53. Returns the number of colors in the ramp
  54. .. _class_Gradient_interpolate:
  55. - :ref:`Color<class_color>` **interpolate** **(** :ref:`float<class_float>` offset **)**
  56. Returns the interpolated color specified by *offset*
  57. .. _class_Gradient_remove_point:
  58. - void **remove_point** **(** :ref:`int<class_int>` offset **)**
  59. Removes the color at the index *offset*
  60. .. _class_Gradient_set_color:
  61. - void **set_color** **(** :ref:`int<class_int>` point, :ref:`Color<class_color>` color **)**
  62. Sets the color of the ramp color at index *point*
  63. .. _class_Gradient_set_offset:
  64. - void **set_offset** **(** :ref:`int<class_int>` point, :ref:`float<class_float>` offset **)**
  65. Sets the offset for the ramp color at index *point*