class_canvasitemmaterial.rst 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  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/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/CanvasItemMaterial.xml.
  6. .. _class_CanvasItemMaterial:
  7. CanvasItemMaterial
  8. ==================
  9. **Inherits:** :ref:`Material<class_Material>` **<** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. A material for :ref:`CanvasItem<class_CanvasItem>`\ s.
  11. Description
  12. -----------
  13. ``CanvasItemMaterial``\ s provide a means of modifying the textures associated with a CanvasItem. They specialize in describing blend and lighting behaviors for textures. Use a :ref:`ShaderMaterial<class_ShaderMaterial>` to more fully customize a material's interactions with a :ref:`CanvasItem<class_CanvasItem>`.
  14. Properties
  15. ----------
  16. +-----------------------------------------------------+-------------------------------------------------------------------------------------------+-----------+
  17. | :ref:`BlendMode<enum_CanvasItemMaterial_BlendMode>` | :ref:`blend_mode<class_CanvasItemMaterial_property_blend_mode>` | ``0`` |
  18. +-----------------------------------------------------+-------------------------------------------------------------------------------------------+-----------+
  19. | :ref:`LightMode<enum_CanvasItemMaterial_LightMode>` | :ref:`light_mode<class_CanvasItemMaterial_property_light_mode>` | ``0`` |
  20. +-----------------------------------------------------+-------------------------------------------------------------------------------------------+-----------+
  21. | :ref:`int<class_int>` | :ref:`particles_anim_h_frames<class_CanvasItemMaterial_property_particles_anim_h_frames>` | |
  22. +-----------------------------------------------------+-------------------------------------------------------------------------------------------+-----------+
  23. | :ref:`bool<class_bool>` | :ref:`particles_anim_loop<class_CanvasItemMaterial_property_particles_anim_loop>` | |
  24. +-----------------------------------------------------+-------------------------------------------------------------------------------------------+-----------+
  25. | :ref:`int<class_int>` | :ref:`particles_anim_v_frames<class_CanvasItemMaterial_property_particles_anim_v_frames>` | |
  26. +-----------------------------------------------------+-------------------------------------------------------------------------------------------+-----------+
  27. | :ref:`bool<class_bool>` | :ref:`particles_animation<class_CanvasItemMaterial_property_particles_animation>` | ``false`` |
  28. +-----------------------------------------------------+-------------------------------------------------------------------------------------------+-----------+
  29. Enumerations
  30. ------------
  31. .. _enum_CanvasItemMaterial_BlendMode:
  32. .. _class_CanvasItemMaterial_constant_BLEND_MODE_MIX:
  33. .. _class_CanvasItemMaterial_constant_BLEND_MODE_ADD:
  34. .. _class_CanvasItemMaterial_constant_BLEND_MODE_SUB:
  35. .. _class_CanvasItemMaterial_constant_BLEND_MODE_MUL:
  36. .. _class_CanvasItemMaterial_constant_BLEND_MODE_PREMULT_ALPHA:
  37. enum **BlendMode**:
  38. - **BLEND_MODE_MIX** = **0** --- Mix blending mode. Colors are assumed to be independent of the alpha (opacity) value.
  39. - **BLEND_MODE_ADD** = **1** --- Additive blending mode.
  40. - **BLEND_MODE_SUB** = **2** --- Subtractive blending mode.
  41. - **BLEND_MODE_MUL** = **3** --- Multiplicative blending mode.
  42. - **BLEND_MODE_PREMULT_ALPHA** = **4** --- Mix blending mode. Colors are assumed to be premultiplied by the alpha (opacity) value.
  43. ----
  44. .. _enum_CanvasItemMaterial_LightMode:
  45. .. _class_CanvasItemMaterial_constant_LIGHT_MODE_NORMAL:
  46. .. _class_CanvasItemMaterial_constant_LIGHT_MODE_UNSHADED:
  47. .. _class_CanvasItemMaterial_constant_LIGHT_MODE_LIGHT_ONLY:
  48. enum **LightMode**:
  49. - **LIGHT_MODE_NORMAL** = **0** --- Render the material using both light and non-light sensitive material properties.
  50. - **LIGHT_MODE_UNSHADED** = **1** --- Render the material as if there were no light.
  51. - **LIGHT_MODE_LIGHT_ONLY** = **2** --- Render the material as if there were only light.
  52. Property Descriptions
  53. ---------------------
  54. .. _class_CanvasItemMaterial_property_blend_mode:
  55. - :ref:`BlendMode<enum_CanvasItemMaterial_BlendMode>` **blend_mode**
  56. +-----------+-----------------------+
  57. | *Default* | ``0`` |
  58. +-----------+-----------------------+
  59. | *Setter* | set_blend_mode(value) |
  60. +-----------+-----------------------+
  61. | *Getter* | get_blend_mode() |
  62. +-----------+-----------------------+
  63. The manner in which a material's rendering is applied to underlying textures.
  64. ----
  65. .. _class_CanvasItemMaterial_property_light_mode:
  66. - :ref:`LightMode<enum_CanvasItemMaterial_LightMode>` **light_mode**
  67. +-----------+-----------------------+
  68. | *Default* | ``0`` |
  69. +-----------+-----------------------+
  70. | *Setter* | set_light_mode(value) |
  71. +-----------+-----------------------+
  72. | *Getter* | get_light_mode() |
  73. +-----------+-----------------------+
  74. The manner in which material reacts to lighting.
  75. ----
  76. .. _class_CanvasItemMaterial_property_particles_anim_h_frames:
  77. - :ref:`int<class_int>` **particles_anim_h_frames**
  78. +----------+------------------------------------+
  79. | *Setter* | set_particles_anim_h_frames(value) |
  80. +----------+------------------------------------+
  81. | *Getter* | get_particles_anim_h_frames() |
  82. +----------+------------------------------------+
  83. The number of columns in the spritesheet assigned as :ref:`Texture2D<class_Texture2D>` for a :ref:`GPUParticles2D<class_GPUParticles2D>` or :ref:`CPUParticles2D<class_CPUParticles2D>`.
  84. \ **Note:** This property is only used and visible in the editor if :ref:`particles_animation<class_CanvasItemMaterial_property_particles_animation>` is ``true``.
  85. ----
  86. .. _class_CanvasItemMaterial_property_particles_anim_loop:
  87. - :ref:`bool<class_bool>` **particles_anim_loop**
  88. +----------+--------------------------------+
  89. | *Setter* | set_particles_anim_loop(value) |
  90. +----------+--------------------------------+
  91. | *Getter* | get_particles_anim_loop() |
  92. +----------+--------------------------------+
  93. If ``true``, the particles animation will loop.
  94. \ **Note:** This property is only used and visible in the editor if :ref:`particles_animation<class_CanvasItemMaterial_property_particles_animation>` is ``true``.
  95. ----
  96. .. _class_CanvasItemMaterial_property_particles_anim_v_frames:
  97. - :ref:`int<class_int>` **particles_anim_v_frames**
  98. +----------+------------------------------------+
  99. | *Setter* | set_particles_anim_v_frames(value) |
  100. +----------+------------------------------------+
  101. | *Getter* | get_particles_anim_v_frames() |
  102. +----------+------------------------------------+
  103. The number of rows in the spritesheet assigned as :ref:`Texture2D<class_Texture2D>` for a :ref:`GPUParticles2D<class_GPUParticles2D>` or :ref:`CPUParticles2D<class_CPUParticles2D>`.
  104. \ **Note:** This property is only used and visible in the editor if :ref:`particles_animation<class_CanvasItemMaterial_property_particles_animation>` is ``true``.
  105. ----
  106. .. _class_CanvasItemMaterial_property_particles_animation:
  107. - :ref:`bool<class_bool>` **particles_animation**
  108. +-----------+--------------------------------+
  109. | *Default* | ``false`` |
  110. +-----------+--------------------------------+
  111. | *Setter* | set_particles_animation(value) |
  112. +-----------+--------------------------------+
  113. | *Getter* | get_particles_animation() |
  114. +-----------+--------------------------------+
  115. If ``true``, enable spritesheet-based animation features when assigned to :ref:`GPUParticles2D<class_GPUParticles2D>` and :ref:`CPUParticles2D<class_CPUParticles2D>` nodes. The :ref:`ParticlesMaterial.anim_speed_max<class_ParticlesMaterial_property_anim_speed_max>` or :ref:`CPUParticles2D.anim_speed_max<class_CPUParticles2D_property_anim_speed_max>` should also be set to a positive value for the animation to play.
  116. This property (and other ``particles_anim_*`` properties that depend on it) has no effect on other types of nodes.
  117. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  118. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  119. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  120. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  121. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  122. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`