class_gradienttexture.rst 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/3.6/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/3.6/doc/classes/GradientTexture.xml.
  6. .. _class_GradientTexture:
  7. GradientTexture
  8. ===============
  9. **Inherits:** :ref:`Texture<class_Texture>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
  10. Gradient-filled texture.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. GradientTexture uses a :ref:`Gradient<class_Gradient>` to fill the texture data. The gradient will be filled from left to right using colors obtained from the gradient. This means the texture does not necessarily represent an exact copy of the gradient, but instead an interpolation of samples obtained from the gradient at fixed steps (see :ref:`width<class_GradientTexture_property_width>`). See also :ref:`GradientTexture2D<class_GradientTexture2D>` and :ref:`CurveTexture<class_CurveTexture>`.
  15. .. rst-class:: classref-reftable-group
  16. Properties
  17. ----------
  18. .. table::
  19. :widths: auto
  20. +---------------------------------+----------------------------------------------------------+-----------+
  21. | :ref:`Gradient<class_Gradient>` | :ref:`gradient<class_GradientTexture_property_gradient>` | |
  22. +---------------------------------+----------------------------------------------------------+-----------+
  23. | :ref:`bool<class_bool>` | :ref:`use_hdr<class_GradientTexture_property_use_hdr>` | ``false`` |
  24. +---------------------------------+----------------------------------------------------------+-----------+
  25. | :ref:`int<class_int>` | :ref:`width<class_GradientTexture_property_width>` | ``2048`` |
  26. +---------------------------------+----------------------------------------------------------+-----------+
  27. .. rst-class:: classref-section-separator
  28. ----
  29. .. rst-class:: classref-descriptions-group
  30. Property Descriptions
  31. ---------------------
  32. .. _class_GradientTexture_property_gradient:
  33. .. rst-class:: classref-property
  34. :ref:`Gradient<class_Gradient>` **gradient**
  35. .. rst-class:: classref-property-setget
  36. - void **set_gradient** **(** :ref:`Gradient<class_Gradient>` value **)**
  37. - :ref:`Gradient<class_Gradient>` **get_gradient** **(** **)**
  38. The :ref:`Gradient<class_Gradient>` that will be used to fill the texture.
  39. .. rst-class:: classref-item-separator
  40. ----
  41. .. _class_GradientTexture_property_use_hdr:
  42. .. rst-class:: classref-property
  43. :ref:`bool<class_bool>` **use_hdr** = ``false``
  44. .. rst-class:: classref-property-setget
  45. - void **set_use_hdr** **(** :ref:`bool<class_bool>` value **)**
  46. - :ref:`bool<class_bool>` **is_using_hdr** **(** **)**
  47. If ``true``, the generated texture will support high dynamic range (:ref:`Image.FORMAT_RGBAF<class_Image_constant_FORMAT_RGBAF>` format). This allows for glow effects to work if :ref:`Environment.glow_enabled<class_Environment_property_glow_enabled>` is ``true``. If ``false``, the generated texture will use low dynamic range; overbright colors will be clamped (:ref:`Image.FORMAT_RGBA8<class_Image_constant_FORMAT_RGBA8>` format).
  48. .. rst-class:: classref-item-separator
  49. ----
  50. .. _class_GradientTexture_property_width:
  51. .. rst-class:: classref-property
  52. :ref:`int<class_int>` **width** = ``2048``
  53. .. rst-class:: classref-property-setget
  54. - void **set_width** **(** :ref:`int<class_int>` value **)**
  55. - :ref:`int<class_int>` **get_width** **(** **)**
  56. The number of color samples that will be obtained from the :ref:`Gradient<class_Gradient>`.
  57. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  58. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  59. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  60. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`