class_particles2d.rst 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead.
  3. .. _class_Particles2D:
  4. Particles2D
  5. ===========
  6. **Inherits:** :ref:`Node2D<class_node2d>` **<** :ref:`CanvasItem<class_canvasitem>` **<** :ref:`Node<class_node>` **<** :ref:`Object<class_object>`
  7. **Category:** Core
  8. Brief Description
  9. -----------------
  10. 2D Particle emitter
  11. Member Functions
  12. ----------------
  13. +----------------------------------+----------------------------------------------------------------------------------------------------------------------------+
  14. | :ref:`Rect2<class_rect2>` | :ref:`capture_rect<class_Particles2D_capture_rect>` **(** **)** const |
  15. +----------------------------------+----------------------------------------------------------------------------------------------------------------------------+
  16. | :ref:`int<class_int>` | :ref:`get_amount<class_Particles2D_get_amount>` **(** **)** const |
  17. +----------------------------------+----------------------------------------------------------------------------------------------------------------------------+
  18. | :ref:`int<class_int>` | :ref:`get_draw_order<class_Particles2D_get_draw_order>` **(** **)** const |
  19. +----------------------------------+----------------------------------------------------------------------------------------------------------------------------+
  20. | :ref:`float<class_float>` | :ref:`get_explosiveness_ratio<class_Particles2D_get_explosiveness_ratio>` **(** **)** const |
  21. +----------------------------------+----------------------------------------------------------------------------------------------------------------------------+
  22. | :ref:`int<class_int>` | :ref:`get_fixed_fps<class_Particles2D_get_fixed_fps>` **(** **)** const |
  23. +----------------------------------+----------------------------------------------------------------------------------------------------------------------------+
  24. | :ref:`bool<class_bool>` | :ref:`get_fractional_delta<class_Particles2D_get_fractional_delta>` **(** **)** const |
  25. +----------------------------------+----------------------------------------------------------------------------------------------------------------------------+
  26. | :ref:`int<class_int>` | :ref:`get_h_frames<class_Particles2D_get_h_frames>` **(** **)** const |
  27. +----------------------------------+----------------------------------------------------------------------------------------------------------------------------+
  28. | :ref:`float<class_float>` | :ref:`get_lifetime<class_Particles2D_get_lifetime>` **(** **)** const |
  29. +----------------------------------+----------------------------------------------------------------------------------------------------------------------------+
  30. | :ref:`Texture<class_texture>` | :ref:`get_normal_map<class_Particles2D_get_normal_map>` **(** **)** const |
  31. +----------------------------------+----------------------------------------------------------------------------------------------------------------------------+
  32. | :ref:`bool<class_bool>` | :ref:`get_one_shot<class_Particles2D_get_one_shot>` **(** **)** const |
  33. +----------------------------------+----------------------------------------------------------------------------------------------------------------------------+
  34. | :ref:`float<class_float>` | :ref:`get_pre_process_time<class_Particles2D_get_pre_process_time>` **(** **)** const |
  35. +----------------------------------+----------------------------------------------------------------------------------------------------------------------------+
  36. | :ref:`Material<class_material>` | :ref:`get_process_material<class_Particles2D_get_process_material>` **(** **)** const |
  37. +----------------------------------+----------------------------------------------------------------------------------------------------------------------------+
  38. | :ref:`float<class_float>` | :ref:`get_randomness_ratio<class_Particles2D_get_randomness_ratio>` **(** **)** const |
  39. +----------------------------------+----------------------------------------------------------------------------------------------------------------------------+
  40. | :ref:`float<class_float>` | :ref:`get_speed_scale<class_Particles2D_get_speed_scale>` **(** **)** const |
  41. +----------------------------------+----------------------------------------------------------------------------------------------------------------------------+
  42. | :ref:`Texture<class_texture>` | :ref:`get_texture<class_Particles2D_get_texture>` **(** **)** const |
  43. +----------------------------------+----------------------------------------------------------------------------------------------------------------------------+
  44. | :ref:`bool<class_bool>` | :ref:`get_use_local_coordinates<class_Particles2D_get_use_local_coordinates>` **(** **)** const |
  45. +----------------------------------+----------------------------------------------------------------------------------------------------------------------------+
  46. | :ref:`int<class_int>` | :ref:`get_v_frames<class_Particles2D_get_v_frames>` **(** **)** const |
  47. +----------------------------------+----------------------------------------------------------------------------------------------------------------------------+
  48. | :ref:`Rect2<class_rect2>` | :ref:`get_visibility_rect<class_Particles2D_get_visibility_rect>` **(** **)** const |
  49. +----------------------------------+----------------------------------------------------------------------------------------------------------------------------+
  50. | :ref:`bool<class_bool>` | :ref:`is_emitting<class_Particles2D_is_emitting>` **(** **)** const |
  51. +----------------------------------+----------------------------------------------------------------------------------------------------------------------------+
  52. | void | :ref:`restart<class_Particles2D_restart>` **(** **)** |
  53. +----------------------------------+----------------------------------------------------------------------------------------------------------------------------+
  54. | void | :ref:`set_amount<class_Particles2D_set_amount>` **(** :ref:`int<class_int>` amount **)** |
  55. +----------------------------------+----------------------------------------------------------------------------------------------------------------------------+
  56. | void | :ref:`set_draw_order<class_Particles2D_set_draw_order>` **(** :ref:`int<class_int>` order **)** |
  57. +----------------------------------+----------------------------------------------------------------------------------------------------------------------------+
  58. | void | :ref:`set_emitting<class_Particles2D_set_emitting>` **(** :ref:`bool<class_bool>` emitting **)** |
  59. +----------------------------------+----------------------------------------------------------------------------------------------------------------------------+
  60. | void | :ref:`set_explosiveness_ratio<class_Particles2D_set_explosiveness_ratio>` **(** :ref:`float<class_float>` ratio **)** |
  61. +----------------------------------+----------------------------------------------------------------------------------------------------------------------------+
  62. | void | :ref:`set_fixed_fps<class_Particles2D_set_fixed_fps>` **(** :ref:`int<class_int>` fps **)** |
  63. +----------------------------------+----------------------------------------------------------------------------------------------------------------------------+
  64. | void | :ref:`set_fractional_delta<class_Particles2D_set_fractional_delta>` **(** :ref:`bool<class_bool>` enable **)** |
  65. +----------------------------------+----------------------------------------------------------------------------------------------------------------------------+
  66. | void | :ref:`set_h_frames<class_Particles2D_set_h_frames>` **(** :ref:`int<class_int>` frames **)** |
  67. +----------------------------------+----------------------------------------------------------------------------------------------------------------------------+
  68. | void | :ref:`set_lifetime<class_Particles2D_set_lifetime>` **(** :ref:`float<class_float>` secs **)** |
  69. +----------------------------------+----------------------------------------------------------------------------------------------------------------------------+
  70. | void | :ref:`set_normal_map<class_Particles2D_set_normal_map>` **(** :ref:`Texture<class_texture>` texture **)** |
  71. +----------------------------------+----------------------------------------------------------------------------------------------------------------------------+
  72. | void | :ref:`set_one_shot<class_Particles2D_set_one_shot>` **(** :ref:`bool<class_bool>` secs **)** |
  73. +----------------------------------+----------------------------------------------------------------------------------------------------------------------------+
  74. | void | :ref:`set_pre_process_time<class_Particles2D_set_pre_process_time>` **(** :ref:`float<class_float>` secs **)** |
  75. +----------------------------------+----------------------------------------------------------------------------------------------------------------------------+
  76. | void | :ref:`set_process_material<class_Particles2D_set_process_material>` **(** :ref:`Material<class_material>` material **)** |
  77. +----------------------------------+----------------------------------------------------------------------------------------------------------------------------+
  78. | void | :ref:`set_randomness_ratio<class_Particles2D_set_randomness_ratio>` **(** :ref:`float<class_float>` ratio **)** |
  79. +----------------------------------+----------------------------------------------------------------------------------------------------------------------------+
  80. | void | :ref:`set_speed_scale<class_Particles2D_set_speed_scale>` **(** :ref:`float<class_float>` scale **)** |
  81. +----------------------------------+----------------------------------------------------------------------------------------------------------------------------+
  82. | void | :ref:`set_texture<class_Particles2D_set_texture>` **(** :ref:`Texture<class_texture>` texture **)** |
  83. +----------------------------------+----------------------------------------------------------------------------------------------------------------------------+
  84. | void | :ref:`set_use_local_coordinates<class_Particles2D_set_use_local_coordinates>` **(** :ref:`bool<class_bool>` enable **)** |
  85. +----------------------------------+----------------------------------------------------------------------------------------------------------------------------+
  86. | void | :ref:`set_v_frames<class_Particles2D_set_v_frames>` **(** :ref:`int<class_int>` frames **)** |
  87. +----------------------------------+----------------------------------------------------------------------------------------------------------------------------+
  88. | void | :ref:`set_visibility_rect<class_Particles2D_set_visibility_rect>` **(** :ref:`Rect2<class_rect2>` aabb **)** |
  89. +----------------------------------+----------------------------------------------------------------------------------------------------------------------------+
  90. Member Variables
  91. ----------------
  92. - :ref:`int<class_int>` **amount**
  93. - :ref:`int<class_int>` **draw_order**
  94. - :ref:`bool<class_bool>` **emitting**
  95. - :ref:`float<class_float>` **explosiveness**
  96. - :ref:`int<class_int>` **fixed_fps**
  97. - :ref:`bool<class_bool>` **fract_delta**
  98. - :ref:`int<class_int>` **h_frames**
  99. - :ref:`float<class_float>` **lifetime**
  100. - :ref:`bool<class_bool>` **local_coords**
  101. - :ref:`Texture<class_texture>` **normal_map**
  102. - :ref:`bool<class_bool>` **one_shot**
  103. - :ref:`float<class_float>` **preprocess**
  104. - ShaderMaterial,ParticlesMaterial **process_material**
  105. - :ref:`float<class_float>` **randomness**
  106. - :ref:`float<class_float>` **speed_scale**
  107. - :ref:`Texture<class_texture>` **texture**
  108. - :ref:`int<class_int>` **v_frames**
  109. - :ref:`Rect3<class_rect3>` **visibility_rect**
  110. Numeric Constants
  111. -----------------
  112. - **DRAW_ORDER_INDEX** = **0**
  113. - **DRAW_ORDER_LIFETIME** = **1**
  114. Description
  115. -----------
  116. Particles2D is a particle system 2D :ref:`Node<class_node>` that is used to simulate several types of particle effects, such as explosions, rain, snow, fireflies, or other magical-like shinny sparkles. Particles are drawn using impostors, and given their dynamic behavior, the user must provide a visibility bounding box (although helpers to create one automatically exist).
  117. Member Function Description
  118. ---------------------------
  119. .. _class_Particles2D_capture_rect:
  120. - :ref:`Rect2<class_rect2>` **capture_rect** **(** **)** const
  121. .. _class_Particles2D_get_amount:
  122. - :ref:`int<class_int>` **get_amount** **(** **)** const
  123. Returns the amount of particles spawned at each emission
  124. .. _class_Particles2D_get_draw_order:
  125. - :ref:`int<class_int>` **get_draw_order** **(** **)** const
  126. .. _class_Particles2D_get_explosiveness_ratio:
  127. - :ref:`float<class_float>` **get_explosiveness_ratio** **(** **)** const
  128. .. _class_Particles2D_get_fixed_fps:
  129. - :ref:`int<class_int>` **get_fixed_fps** **(** **)** const
  130. .. _class_Particles2D_get_fractional_delta:
  131. - :ref:`bool<class_bool>` **get_fractional_delta** **(** **)** const
  132. .. _class_Particles2D_get_h_frames:
  133. - :ref:`int<class_int>` **get_h_frames** **(** **)** const
  134. .. _class_Particles2D_get_lifetime:
  135. - :ref:`float<class_float>` **get_lifetime** **(** **)** const
  136. Gets the amount of seconds that each particle will be visible.
  137. .. _class_Particles2D_get_normal_map:
  138. - :ref:`Texture<class_texture>` **get_normal_map** **(** **)** const
  139. .. _class_Particles2D_get_one_shot:
  140. - :ref:`bool<class_bool>` **get_one_shot** **(** **)** const
  141. .. _class_Particles2D_get_pre_process_time:
  142. - :ref:`float<class_float>` **get_pre_process_time** **(** **)** const
  143. .. _class_Particles2D_get_process_material:
  144. - :ref:`Material<class_material>` **get_process_material** **(** **)** const
  145. .. _class_Particles2D_get_randomness_ratio:
  146. - :ref:`float<class_float>` **get_randomness_ratio** **(** **)** const
  147. .. _class_Particles2D_get_speed_scale:
  148. - :ref:`float<class_float>` **get_speed_scale** **(** **)** const
  149. .. _class_Particles2D_get_texture:
  150. - :ref:`Texture<class_texture>` **get_texture** **(** **)** const
  151. Returns the texture for emitted particles
  152. .. _class_Particles2D_get_use_local_coordinates:
  153. - :ref:`bool<class_bool>` **get_use_local_coordinates** **(** **)** const
  154. .. _class_Particles2D_get_v_frames:
  155. - :ref:`int<class_int>` **get_v_frames** **(** **)** const
  156. .. _class_Particles2D_get_visibility_rect:
  157. - :ref:`Rect2<class_rect2>` **get_visibility_rect** **(** **)** const
  158. .. _class_Particles2D_is_emitting:
  159. - :ref:`bool<class_bool>` **is_emitting** **(** **)** const
  160. Returns whether this emitter is currently emitting or not
  161. .. _class_Particles2D_restart:
  162. - void **restart** **(** **)**
  163. .. _class_Particles2D_set_amount:
  164. - void **set_amount** **(** :ref:`int<class_int>` amount **)**
  165. Sets the amount of particles spawned at each emission
  166. .. _class_Particles2D_set_draw_order:
  167. - void **set_draw_order** **(** :ref:`int<class_int>` order **)**
  168. .. _class_Particles2D_set_emitting:
  169. - void **set_emitting** **(** :ref:`bool<class_bool>` emitting **)**
  170. If this is set to true then the particle emitter will emit particles, if its false it will not.
  171. .. _class_Particles2D_set_explosiveness_ratio:
  172. - void **set_explosiveness_ratio** **(** :ref:`float<class_float>` ratio **)**
  173. .. _class_Particles2D_set_fixed_fps:
  174. - void **set_fixed_fps** **(** :ref:`int<class_int>` fps **)**
  175. .. _class_Particles2D_set_fractional_delta:
  176. - void **set_fractional_delta** **(** :ref:`bool<class_bool>` enable **)**
  177. .. _class_Particles2D_set_h_frames:
  178. - void **set_h_frames** **(** :ref:`int<class_int>` frames **)**
  179. .. _class_Particles2D_set_lifetime:
  180. - void **set_lifetime** **(** :ref:`float<class_float>` secs **)**
  181. Sets the amount of seconds that each particle will be visible.
  182. .. _class_Particles2D_set_normal_map:
  183. - void **set_normal_map** **(** :ref:`Texture<class_texture>` texture **)**
  184. .. _class_Particles2D_set_one_shot:
  185. - void **set_one_shot** **(** :ref:`bool<class_bool>` secs **)**
  186. .. _class_Particles2D_set_pre_process_time:
  187. - void **set_pre_process_time** **(** :ref:`float<class_float>` secs **)**
  188. .. _class_Particles2D_set_process_material:
  189. - void **set_process_material** **(** :ref:`Material<class_material>` material **)**
  190. .. _class_Particles2D_set_randomness_ratio:
  191. - void **set_randomness_ratio** **(** :ref:`float<class_float>` ratio **)**
  192. .. _class_Particles2D_set_speed_scale:
  193. - void **set_speed_scale** **(** :ref:`float<class_float>` scale **)**
  194. .. _class_Particles2D_set_texture:
  195. - void **set_texture** **(** :ref:`Texture<class_texture>` texture **)**
  196. .. _class_Particles2D_set_use_local_coordinates:
  197. - void **set_use_local_coordinates** **(** :ref:`bool<class_bool>` enable **)**
  198. .. _class_Particles2D_set_v_frames:
  199. - void **set_v_frames** **(** :ref:`int<class_int>` frames **)**
  200. .. _class_Particles2D_set_visibility_rect:
  201. - void **set_visibility_rect** **(** :ref:`Rect2<class_rect2>` aabb **)**