class_particles2d.rst 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  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_property_amount>` |
  16. +----------------------------------------------+----------------------------------------------------------------------+
  17. | :ref:`DrawOrder<enum_Particles2D_DrawOrder>` | :ref:`draw_order<class_Particles2D_property_draw_order>` |
  18. +----------------------------------------------+----------------------------------------------------------------------+
  19. | :ref:`bool<class_bool>` | :ref:`emitting<class_Particles2D_property_emitting>` |
  20. +----------------------------------------------+----------------------------------------------------------------------+
  21. | :ref:`float<class_float>` | :ref:`explosiveness<class_Particles2D_property_explosiveness>` |
  22. +----------------------------------------------+----------------------------------------------------------------------+
  23. | :ref:`int<class_int>` | :ref:`fixed_fps<class_Particles2D_property_fixed_fps>` |
  24. +----------------------------------------------+----------------------------------------------------------------------+
  25. | :ref:`bool<class_bool>` | :ref:`fract_delta<class_Particles2D_property_fract_delta>` |
  26. +----------------------------------------------+----------------------------------------------------------------------+
  27. | :ref:`float<class_float>` | :ref:`lifetime<class_Particles2D_property_lifetime>` |
  28. +----------------------------------------------+----------------------------------------------------------------------+
  29. | :ref:`bool<class_bool>` | :ref:`local_coords<class_Particles2D_property_local_coords>` |
  30. +----------------------------------------------+----------------------------------------------------------------------+
  31. | :ref:`Texture<class_Texture>` | :ref:`normal_map<class_Particles2D_property_normal_map>` |
  32. +----------------------------------------------+----------------------------------------------------------------------+
  33. | :ref:`bool<class_bool>` | :ref:`one_shot<class_Particles2D_property_one_shot>` |
  34. +----------------------------------------------+----------------------------------------------------------------------+
  35. | :ref:`float<class_float>` | :ref:`preprocess<class_Particles2D_property_preprocess>` |
  36. +----------------------------------------------+----------------------------------------------------------------------+
  37. | :ref:`Material<class_Material>` | :ref:`process_material<class_Particles2D_property_process_material>` |
  38. +----------------------------------------------+----------------------------------------------------------------------+
  39. | :ref:`float<class_float>` | :ref:`randomness<class_Particles2D_property_randomness>` |
  40. +----------------------------------------------+----------------------------------------------------------------------+
  41. | :ref:`float<class_float>` | :ref:`speed_scale<class_Particles2D_property_speed_scale>` |
  42. +----------------------------------------------+----------------------------------------------------------------------+
  43. | :ref:`Texture<class_Texture>` | :ref:`texture<class_Particles2D_property_texture>` |
  44. +----------------------------------------------+----------------------------------------------------------------------+
  45. | :ref:`Rect2<class_Rect2>` | :ref:`visibility_rect<class_Particles2D_property_visibility_rect>` |
  46. +----------------------------------------------+----------------------------------------------------------------------+
  47. Methods
  48. -------
  49. +---------------------------+------------------------------------------------------------------------------+
  50. | :ref:`Rect2<class_Rect2>` | :ref:`capture_rect<class_Particles2D_method_capture_rect>` **(** **)** const |
  51. +---------------------------+------------------------------------------------------------------------------+
  52. | void | :ref:`restart<class_Particles2D_method_restart>` **(** **)** |
  53. +---------------------------+------------------------------------------------------------------------------+
  54. Enumerations
  55. ------------
  56. .. _enum_Particles2D_DrawOrder:
  57. .. _class_Particles2D_constant_DRAW_ORDER_INDEX:
  58. .. _class_Particles2D_constant_DRAW_ORDER_LIFETIME:
  59. enum **DrawOrder**:
  60. - **DRAW_ORDER_INDEX** = **0** --- Particles are drawn in the order emitted.
  61. - **DRAW_ORDER_LIFETIME** = **1** --- Particles are drawn in order of remaining lifetime.
  62. Description
  63. -----------
  64. 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.
  65. 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.
  66. Property Descriptions
  67. ---------------------
  68. .. _class_Particles2D_property_amount:
  69. - :ref:`int<class_int>` **amount**
  70. +----------+-------------------+
  71. | *Setter* | set_amount(value) |
  72. +----------+-------------------+
  73. | *Getter* | get_amount() |
  74. +----------+-------------------+
  75. Number of particles emitted in one emission cycle.
  76. .. _class_Particles2D_property_draw_order:
  77. - :ref:`DrawOrder<enum_Particles2D_DrawOrder>` **draw_order**
  78. +----------+-----------------------+
  79. | *Setter* | set_draw_order(value) |
  80. +----------+-----------------------+
  81. | *Getter* | get_draw_order() |
  82. +----------+-----------------------+
  83. Particle draw order. Uses ``DRAW_ORDER_*`` values. Default value: ``DRAW_ORDER_INDEX``.
  84. .. _class_Particles2D_property_emitting:
  85. - :ref:`bool<class_bool>` **emitting**
  86. +----------+---------------------+
  87. | *Setter* | set_emitting(value) |
  88. +----------+---------------------+
  89. | *Getter* | is_emitting() |
  90. +----------+---------------------+
  91. If ``true``, particles are being emitted. Default value: ``true``.
  92. .. _class_Particles2D_property_explosiveness:
  93. - :ref:`float<class_float>` **explosiveness**
  94. +----------+--------------------------------+
  95. | *Setter* | set_explosiveness_ratio(value) |
  96. +----------+--------------------------------+
  97. | *Getter* | get_explosiveness_ratio() |
  98. +----------+--------------------------------+
  99. 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``.
  100. .. _class_Particles2D_property_fixed_fps:
  101. - :ref:`int<class_int>` **fixed_fps**
  102. +----------+----------------------+
  103. | *Setter* | set_fixed_fps(value) |
  104. +----------+----------------------+
  105. | *Getter* | get_fixed_fps() |
  106. +----------+----------------------+
  107. The particle system's frame rate is fixed to a value. For instance, changing the value to 2 will make the particles render at 2 frames per second. Note this does not slow down the particle system itself.
  108. .. _class_Particles2D_property_fract_delta:
  109. - :ref:`bool<class_bool>` **fract_delta**
  110. +----------+-----------------------------+
  111. | *Setter* | set_fractional_delta(value) |
  112. +----------+-----------------------------+
  113. | *Getter* | get_fractional_delta() |
  114. +----------+-----------------------------+
  115. If ``true``, results in fractional delta calculation which has a smoother particles display effect. Default value: ``true``
  116. .. _class_Particles2D_property_lifetime:
  117. - :ref:`float<class_float>` **lifetime**
  118. +----------+---------------------+
  119. | *Setter* | set_lifetime(value) |
  120. +----------+---------------------+
  121. | *Getter* | get_lifetime() |
  122. +----------+---------------------+
  123. Amount of time each particle will exist. Default value: ``1``.
  124. .. _class_Particles2D_property_local_coords:
  125. - :ref:`bool<class_bool>` **local_coords**
  126. +----------+----------------------------------+
  127. | *Setter* | set_use_local_coordinates(value) |
  128. +----------+----------------------------------+
  129. | *Getter* | get_use_local_coordinates() |
  130. +----------+----------------------------------+
  131. If ``true``, particles use the parent node's coordinate space. If ``false``, they use global coordinates. Default value: ``true``.
  132. .. _class_Particles2D_property_normal_map:
  133. - :ref:`Texture<class_Texture>` **normal_map**
  134. +----------+-----------------------+
  135. | *Setter* | set_normal_map(value) |
  136. +----------+-----------------------+
  137. | *Getter* | get_normal_map() |
  138. +----------+-----------------------+
  139. Normal map to be used for the ``texture`` property.
  140. .. _class_Particles2D_property_one_shot:
  141. - :ref:`bool<class_bool>` **one_shot**
  142. +----------+---------------------+
  143. | *Setter* | set_one_shot(value) |
  144. +----------+---------------------+
  145. | *Getter* | get_one_shot() |
  146. +----------+---------------------+
  147. If ``true``, only one emission cycle occurs. If set ``true`` during a cycle, emission will stop at the cycle's end. Default value: ``false``.
  148. .. _class_Particles2D_property_preprocess:
  149. - :ref:`float<class_float>` **preprocess**
  150. +----------+-----------------------------+
  151. | *Setter* | set_pre_process_time(value) |
  152. +----------+-----------------------------+
  153. | *Getter* | get_pre_process_time() |
  154. +----------+-----------------------------+
  155. Particle system starts as if it had already run for this many seconds.
  156. .. _class_Particles2D_property_process_material:
  157. - :ref:`Material<class_Material>` **process_material**
  158. +----------+-----------------------------+
  159. | *Setter* | set_process_material(value) |
  160. +----------+-----------------------------+
  161. | *Getter* | get_process_material() |
  162. +----------+-----------------------------+
  163. :ref:`Material<class_Material>` for processing particles. Can be a :ref:`ParticlesMaterial<class_ParticlesMaterial>` or a :ref:`ShaderMaterial<class_ShaderMaterial>`.
  164. .. _class_Particles2D_property_randomness:
  165. - :ref:`float<class_float>` **randomness**
  166. +----------+-----------------------------+
  167. | *Setter* | set_randomness_ratio(value) |
  168. +----------+-----------------------------+
  169. | *Getter* | get_randomness_ratio() |
  170. +----------+-----------------------------+
  171. Emission lifetime randomness ratio. Default value: ``0``.
  172. .. _class_Particles2D_property_speed_scale:
  173. - :ref:`float<class_float>` **speed_scale**
  174. +----------+------------------------+
  175. | *Setter* | set_speed_scale(value) |
  176. +----------+------------------------+
  177. | *Getter* | get_speed_scale() |
  178. +----------+------------------------+
  179. Particle system's running speed scaling ratio. Default value: ``1``. A value of ``0`` can be used to pause the particles.
  180. .. _class_Particles2D_property_texture:
  181. - :ref:`Texture<class_Texture>` **texture**
  182. +----------+--------------------+
  183. | *Setter* | set_texture(value) |
  184. +----------+--------------------+
  185. | *Getter* | get_texture() |
  186. +----------+--------------------+
  187. Particle texture. If ``null`` particles will be squares.
  188. .. _class_Particles2D_property_visibility_rect:
  189. - :ref:`Rect2<class_Rect2>` **visibility_rect**
  190. +----------+----------------------------+
  191. | *Setter* | set_visibility_rect(value) |
  192. +----------+----------------------------+
  193. | *Getter* | get_visibility_rect() |
  194. +----------+----------------------------+
  195. Editor visibility helper.
  196. Method Descriptions
  197. -------------------
  198. .. _class_Particles2D_method_capture_rect:
  199. - :ref:`Rect2<class_Rect2>` **capture_rect** **(** **)** const
  200. Returns a rectangle containing the positions of all existing particles.
  201. .. _class_Particles2D_method_restart:
  202. - void **restart** **(** **)**
  203. Restarts all the existing particles.