class_particles2d.rst 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the Particles2D.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_Particles2D:
  5. Particles2D
  6. ===========
  7. **Inherits:** :ref:`Node2D<class_Node2D>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  8. **Category:** Core
  9. Brief Description
  10. -----------------
  11. 2D particle emitter.
  12. Properties
  13. ----------
  14. +----------------------------------------------+-------------------------------------------------------------+
  15. | :ref:`int<class_int>` | :ref:`amount<class_Particles2D_amount>` |
  16. +----------------------------------------------+-------------------------------------------------------------+
  17. | :ref:`DrawOrder<enum_Particles2D_DrawOrder>` | :ref:`draw_order<class_Particles2D_draw_order>` |
  18. +----------------------------------------------+-------------------------------------------------------------+
  19. | :ref:`bool<class_bool>` | :ref:`emitting<class_Particles2D_emitting>` |
  20. +----------------------------------------------+-------------------------------------------------------------+
  21. | :ref:`float<class_float>` | :ref:`explosiveness<class_Particles2D_explosiveness>` |
  22. +----------------------------------------------+-------------------------------------------------------------+
  23. | :ref:`int<class_int>` | :ref:`fixed_fps<class_Particles2D_fixed_fps>` |
  24. +----------------------------------------------+-------------------------------------------------------------+
  25. | :ref:`bool<class_bool>` | :ref:`fract_delta<class_Particles2D_fract_delta>` |
  26. +----------------------------------------------+-------------------------------------------------------------+
  27. | :ref:`float<class_float>` | :ref:`lifetime<class_Particles2D_lifetime>` |
  28. +----------------------------------------------+-------------------------------------------------------------+
  29. | :ref:`bool<class_bool>` | :ref:`local_coords<class_Particles2D_local_coords>` |
  30. +----------------------------------------------+-------------------------------------------------------------+
  31. | :ref:`Texture<class_Texture>` | :ref:`normal_map<class_Particles2D_normal_map>` |
  32. +----------------------------------------------+-------------------------------------------------------------+
  33. | :ref:`bool<class_bool>` | :ref:`one_shot<class_Particles2D_one_shot>` |
  34. +----------------------------------------------+-------------------------------------------------------------+
  35. | :ref:`float<class_float>` | :ref:`preprocess<class_Particles2D_preprocess>` |
  36. +----------------------------------------------+-------------------------------------------------------------+
  37. | :ref:`Material<class_Material>` | :ref:`process_material<class_Particles2D_process_material>` |
  38. +----------------------------------------------+-------------------------------------------------------------+
  39. | :ref:`float<class_float>` | :ref:`randomness<class_Particles2D_randomness>` |
  40. +----------------------------------------------+-------------------------------------------------------------+
  41. | :ref:`float<class_float>` | :ref:`speed_scale<class_Particles2D_speed_scale>` |
  42. +----------------------------------------------+-------------------------------------------------------------+
  43. | :ref:`Texture<class_Texture>` | :ref:`texture<class_Particles2D_texture>` |
  44. +----------------------------------------------+-------------------------------------------------------------+
  45. | :ref:`Rect2<class_Rect2>` | :ref:`visibility_rect<class_Particles2D_visibility_rect>` |
  46. +----------------------------------------------+-------------------------------------------------------------+
  47. Methods
  48. -------
  49. +----------------------------+-----------------------------------------------------------------------+
  50. | :ref:`Rect2<class_Rect2>` | :ref:`capture_rect<class_Particles2D_capture_rect>` **(** **)** const |
  51. +----------------------------+-----------------------------------------------------------------------+
  52. | void | :ref:`restart<class_Particles2D_restart>` **(** **)** |
  53. +----------------------------+-----------------------------------------------------------------------+
  54. Enumerations
  55. ------------
  56. .. _enum_Particles2D_DrawOrder:
  57. enum **DrawOrder**:
  58. - **DRAW_ORDER_INDEX** = **0** --- Particles are drawn in the order emitted.
  59. - **DRAW_ORDER_LIFETIME** = **1** --- Particles are drawn in order of remaining lifetime.
  60. Description
  61. -----------
  62. 2D particle node used to create a variety of particle systems and effects. ``Particles2D`` features an emitter that generates some number of particles at a given rate.
  63. Use the ``process_material`` property to add a :ref:`ParticlesMaterial<class_ParticlesMaterial>` to configure particle appearance and behavior. Alternatively, you can add a :ref:`ShaderMaterial<class_ShaderMaterial>` which will be applied to all particles.
  64. Property Descriptions
  65. ---------------------
  66. .. _class_Particles2D_amount:
  67. - :ref:`int<class_int>` **amount**
  68. +----------+-------------------+
  69. | *Setter* | set_amount(value) |
  70. +----------+-------------------+
  71. | *Getter* | get_amount() |
  72. +----------+-------------------+
  73. Number of particles emitted in one emission cycle.
  74. .. _class_Particles2D_draw_order:
  75. - :ref:`DrawOrder<enum_Particles2D_DrawOrder>` **draw_order**
  76. +----------+-----------------------+
  77. | *Setter* | set_draw_order(value) |
  78. +----------+-----------------------+
  79. | *Getter* | get_draw_order() |
  80. +----------+-----------------------+
  81. Particle draw order. Uses ``DRAW_ORDER_*`` values. Default value: ``DRAW_ORDER_INDEX``.
  82. .. _class_Particles2D_emitting:
  83. - :ref:`bool<class_bool>` **emitting**
  84. +----------+---------------------+
  85. | *Setter* | set_emitting(value) |
  86. +----------+---------------------+
  87. | *Getter* | is_emitting() |
  88. +----------+---------------------+
  89. If ``true`` particles are being emitted. Default value: ``true``.
  90. .. _class_Particles2D_explosiveness:
  91. - :ref:`float<class_float>` **explosiveness**
  92. +----------+--------------------------------+
  93. | *Setter* | set_explosiveness_ratio(value) |
  94. +----------+--------------------------------+
  95. | *Getter* | get_explosiveness_ratio() |
  96. +----------+--------------------------------+
  97. How rapidly particles in an emission cycle are emitted. If greater than ``0``, there will be a gap in emissions before the next cycle begins. Default value: ``0``.
  98. .. _class_Particles2D_fixed_fps:
  99. - :ref:`int<class_int>` **fixed_fps**
  100. +----------+----------------------+
  101. | *Setter* | set_fixed_fps(value) |
  102. +----------+----------------------+
  103. | *Getter* | get_fixed_fps() |
  104. +----------+----------------------+
  105. .. _class_Particles2D_fract_delta:
  106. - :ref:`bool<class_bool>` **fract_delta**
  107. +----------+-----------------------------+
  108. | *Setter* | set_fractional_delta(value) |
  109. +----------+-----------------------------+
  110. | *Getter* | get_fractional_delta() |
  111. +----------+-----------------------------+
  112. .. _class_Particles2D_lifetime:
  113. - :ref:`float<class_float>` **lifetime**
  114. +----------+---------------------+
  115. | *Setter* | set_lifetime(value) |
  116. +----------+---------------------+
  117. | *Getter* | get_lifetime() |
  118. +----------+---------------------+
  119. Amount of time each particle will exist. Default value: ``1``.
  120. .. _class_Particles2D_local_coords:
  121. - :ref:`bool<class_bool>` **local_coords**
  122. +----------+----------------------------------+
  123. | *Setter* | set_use_local_coordinates(value) |
  124. +----------+----------------------------------+
  125. | *Getter* | get_use_local_coordinates() |
  126. +----------+----------------------------------+
  127. If ``true`` particles use the parent node's coordinate space. If ``false`` they use global coordinates. Default value: ``true``.
  128. .. _class_Particles2D_normal_map:
  129. - :ref:`Texture<class_Texture>` **normal_map**
  130. +----------+-----------------------+
  131. | *Setter* | set_normal_map(value) |
  132. +----------+-----------------------+
  133. | *Getter* | get_normal_map() |
  134. +----------+-----------------------+
  135. .. _class_Particles2D_one_shot:
  136. - :ref:`bool<class_bool>` **one_shot**
  137. +----------+---------------------+
  138. | *Setter* | set_one_shot(value) |
  139. +----------+---------------------+
  140. | *Getter* | get_one_shot() |
  141. +----------+---------------------+
  142. If ``true`` only one emission cycle occurs. If set ``true`` during a cycle, emission will stop at the cycle's end. Default value: ``false``.
  143. .. _class_Particles2D_preprocess:
  144. - :ref:`float<class_float>` **preprocess**
  145. +----------+-----------------------------+
  146. | *Setter* | set_pre_process_time(value) |
  147. +----------+-----------------------------+
  148. | *Getter* | get_pre_process_time() |
  149. +----------+-----------------------------+
  150. Particle system starts as if it had already run for this many seconds.
  151. .. _class_Particles2D_process_material:
  152. - :ref:`Material<class_Material>` **process_material**
  153. +----------+-----------------------------+
  154. | *Setter* | set_process_material(value) |
  155. +----------+-----------------------------+
  156. | *Getter* | get_process_material() |
  157. +----------+-----------------------------+
  158. :ref:`Material<class_Material>` for processing particles. Can be a :ref:`ParticlesMaterial<class_ParticlesMaterial>` or a :ref:`ShaderMaterial<class_ShaderMaterial>`.
  159. .. _class_Particles2D_randomness:
  160. - :ref:`float<class_float>` **randomness**
  161. +----------+-----------------------------+
  162. | *Setter* | set_randomness_ratio(value) |
  163. +----------+-----------------------------+
  164. | *Getter* | get_randomness_ratio() |
  165. +----------+-----------------------------+
  166. Emission lifetime randomness ratio. Default value: ``0``.
  167. .. _class_Particles2D_speed_scale:
  168. - :ref:`float<class_float>` **speed_scale**
  169. +----------+------------------------+
  170. | *Setter* | set_speed_scale(value) |
  171. +----------+------------------------+
  172. | *Getter* | get_speed_scale() |
  173. +----------+------------------------+
  174. Particle system's running speed scaling ratio. Default value: ``1``. A value of ``0`` can be used to pause the particles.
  175. .. _class_Particles2D_texture:
  176. - :ref:`Texture<class_Texture>` **texture**
  177. +----------+--------------------+
  178. | *Setter* | set_texture(value) |
  179. +----------+--------------------+
  180. | *Getter* | get_texture() |
  181. +----------+--------------------+
  182. Particle texture. If ``null`` particles will be squares.
  183. .. _class_Particles2D_visibility_rect:
  184. - :ref:`Rect2<class_Rect2>` **visibility_rect**
  185. +----------+----------------------------+
  186. | *Setter* | set_visibility_rect(value) |
  187. +----------+----------------------------+
  188. | *Getter* | get_visibility_rect() |
  189. +----------+----------------------------+
  190. Editor visibility helper.
  191. Method Descriptions
  192. -------------------
  193. .. _class_Particles2D_capture_rect:
  194. - :ref:`Rect2<class_Rect2>` **capture_rect** **(** **)** const
  195. .. _class_Particles2D_restart:
  196. - void **restart** **(** **)**