class_cpuparticles2d.rst 61 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the CPUParticles2D.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_CPUParticles2D:
  6. CPUParticles2D
  7. ==============
  8. **Inherits:** :ref:`Node2D<class_Node2D>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  9. **Category:** Core
  10. Brief Description
  11. -----------------
  12. CPU-based 2D particle emitter.
  13. Properties
  14. ----------
  15. +---------------------------------------------------------+---------------------------------------------------------------------------------------+---------------------+
  16. | :ref:`int<class_int>` | :ref:`amount<class_CPUParticles2D_property_amount>` | 8 |
  17. +---------------------------------------------------------+---------------------------------------------------------------------------------------+---------------------+
  18. | :ref:`float<class_float>` | :ref:`angle<class_CPUParticles2D_property_angle>` | 0.0 |
  19. +---------------------------------------------------------+---------------------------------------------------------------------------------------+---------------------+
  20. | :ref:`Curve<class_Curve>` | :ref:`angle_curve<class_CPUParticles2D_property_angle_curve>` | |
  21. +---------------------------------------------------------+---------------------------------------------------------------------------------------+---------------------+
  22. | :ref:`float<class_float>` | :ref:`angle_random<class_CPUParticles2D_property_angle_random>` | 0.0 |
  23. +---------------------------------------------------------+---------------------------------------------------------------------------------------+---------------------+
  24. | :ref:`float<class_float>` | :ref:`angular_velocity<class_CPUParticles2D_property_angular_velocity>` | 0.0 |
  25. +---------------------------------------------------------+---------------------------------------------------------------------------------------+---------------------+
  26. | :ref:`Curve<class_Curve>` | :ref:`angular_velocity_curve<class_CPUParticles2D_property_angular_velocity_curve>` | |
  27. +---------------------------------------------------------+---------------------------------------------------------------------------------------+---------------------+
  28. | :ref:`float<class_float>` | :ref:`angular_velocity_random<class_CPUParticles2D_property_angular_velocity_random>` | 0.0 |
  29. +---------------------------------------------------------+---------------------------------------------------------------------------------------+---------------------+
  30. | :ref:`float<class_float>` | :ref:`anim_offset<class_CPUParticles2D_property_anim_offset>` | 0.0 |
  31. +---------------------------------------------------------+---------------------------------------------------------------------------------------+---------------------+
  32. | :ref:`Curve<class_Curve>` | :ref:`anim_offset_curve<class_CPUParticles2D_property_anim_offset_curve>` | |
  33. +---------------------------------------------------------+---------------------------------------------------------------------------------------+---------------------+
  34. | :ref:`float<class_float>` | :ref:`anim_offset_random<class_CPUParticles2D_property_anim_offset_random>` | 0.0 |
  35. +---------------------------------------------------------+---------------------------------------------------------------------------------------+---------------------+
  36. | :ref:`float<class_float>` | :ref:`anim_speed<class_CPUParticles2D_property_anim_speed>` | 0.0 |
  37. +---------------------------------------------------------+---------------------------------------------------------------------------------------+---------------------+
  38. | :ref:`Curve<class_Curve>` | :ref:`anim_speed_curve<class_CPUParticles2D_property_anim_speed_curve>` | |
  39. +---------------------------------------------------------+---------------------------------------------------------------------------------------+---------------------+
  40. | :ref:`float<class_float>` | :ref:`anim_speed_random<class_CPUParticles2D_property_anim_speed_random>` | 0.0 |
  41. +---------------------------------------------------------+---------------------------------------------------------------------------------------+---------------------+
  42. | :ref:`Color<class_Color>` | :ref:`color<class_CPUParticles2D_property_color>` | Color( 1, 1, 1, 1 ) |
  43. +---------------------------------------------------------+---------------------------------------------------------------------------------------+---------------------+
  44. | :ref:`Gradient<class_Gradient>` | :ref:`color_ramp<class_CPUParticles2D_property_color_ramp>` | |
  45. +---------------------------------------------------------+---------------------------------------------------------------------------------------+---------------------+
  46. | :ref:`float<class_float>` | :ref:`damping<class_CPUParticles2D_property_damping>` | 0.0 |
  47. +---------------------------------------------------------+---------------------------------------------------------------------------------------+---------------------+
  48. | :ref:`Curve<class_Curve>` | :ref:`damping_curve<class_CPUParticles2D_property_damping_curve>` | |
  49. +---------------------------------------------------------+---------------------------------------------------------------------------------------+---------------------+
  50. | :ref:`float<class_float>` | :ref:`damping_random<class_CPUParticles2D_property_damping_random>` | 0.0 |
  51. +---------------------------------------------------------+---------------------------------------------------------------------------------------+---------------------+
  52. | :ref:`Vector2<class_Vector2>` | :ref:`direction<class_CPUParticles2D_property_direction>` | Vector2( 1, 0 ) |
  53. +---------------------------------------------------------+---------------------------------------------------------------------------------------+---------------------+
  54. | :ref:`DrawOrder<enum_CPUParticles2D_DrawOrder>` | :ref:`draw_order<class_CPUParticles2D_property_draw_order>` | 0 |
  55. +---------------------------------------------------------+---------------------------------------------------------------------------------------+---------------------+
  56. | :ref:`PoolColorArray<class_PoolColorArray>` | :ref:`emission_colors<class_CPUParticles2D_property_emission_colors>` | |
  57. +---------------------------------------------------------+---------------------------------------------------------------------------------------+---------------------+
  58. | :ref:`PoolVector2Array<class_PoolVector2Array>` | :ref:`emission_normals<class_CPUParticles2D_property_emission_normals>` | |
  59. +---------------------------------------------------------+---------------------------------------------------------------------------------------+---------------------+
  60. | :ref:`PoolVector2Array<class_PoolVector2Array>` | :ref:`emission_points<class_CPUParticles2D_property_emission_points>` | |
  61. +---------------------------------------------------------+---------------------------------------------------------------------------------------+---------------------+
  62. | :ref:`Vector2<class_Vector2>` | :ref:`emission_rect_extents<class_CPUParticles2D_property_emission_rect_extents>` | |
  63. +---------------------------------------------------------+---------------------------------------------------------------------------------------+---------------------+
  64. | :ref:`EmissionShape<enum_CPUParticles2D_EmissionShape>` | :ref:`emission_shape<class_CPUParticles2D_property_emission_shape>` | 0 |
  65. +---------------------------------------------------------+---------------------------------------------------------------------------------------+---------------------+
  66. | :ref:`float<class_float>` | :ref:`emission_sphere_radius<class_CPUParticles2D_property_emission_sphere_radius>` | |
  67. +---------------------------------------------------------+---------------------------------------------------------------------------------------+---------------------+
  68. | :ref:`bool<class_bool>` | :ref:`emitting<class_CPUParticles2D_property_emitting>` | true |
  69. +---------------------------------------------------------+---------------------------------------------------------------------------------------+---------------------+
  70. | :ref:`float<class_float>` | :ref:`explosiveness<class_CPUParticles2D_property_explosiveness>` | 0.0 |
  71. +---------------------------------------------------------+---------------------------------------------------------------------------------------+---------------------+
  72. | :ref:`int<class_int>` | :ref:`fixed_fps<class_CPUParticles2D_property_fixed_fps>` | 0 |
  73. +---------------------------------------------------------+---------------------------------------------------------------------------------------+---------------------+
  74. | :ref:`bool<class_bool>` | :ref:`flag_align_y<class_CPUParticles2D_property_flag_align_y>` | false |
  75. +---------------------------------------------------------+---------------------------------------------------------------------------------------+---------------------+
  76. | :ref:`float<class_float>` | :ref:`flatness<class_CPUParticles2D_property_flatness>` | 0.0 |
  77. +---------------------------------------------------------+---------------------------------------------------------------------------------------+---------------------+
  78. | :ref:`bool<class_bool>` | :ref:`fract_delta<class_CPUParticles2D_property_fract_delta>` | true |
  79. +---------------------------------------------------------+---------------------------------------------------------------------------------------+---------------------+
  80. | :ref:`Vector2<class_Vector2>` | :ref:`gravity<class_CPUParticles2D_property_gravity>` | Vector2( 0, 98 ) |
  81. +---------------------------------------------------------+---------------------------------------------------------------------------------------+---------------------+
  82. | :ref:`float<class_float>` | :ref:`hue_variation<class_CPUParticles2D_property_hue_variation>` | 0.0 |
  83. +---------------------------------------------------------+---------------------------------------------------------------------------------------+---------------------+
  84. | :ref:`Curve<class_Curve>` | :ref:`hue_variation_curve<class_CPUParticles2D_property_hue_variation_curve>` | |
  85. +---------------------------------------------------------+---------------------------------------------------------------------------------------+---------------------+
  86. | :ref:`float<class_float>` | :ref:`hue_variation_random<class_CPUParticles2D_property_hue_variation_random>` | 0.0 |
  87. +---------------------------------------------------------+---------------------------------------------------------------------------------------+---------------------+
  88. | :ref:`float<class_float>` | :ref:`initial_velocity<class_CPUParticles2D_property_initial_velocity>` | 0.0 |
  89. +---------------------------------------------------------+---------------------------------------------------------------------------------------+---------------------+
  90. | :ref:`float<class_float>` | :ref:`initial_velocity_random<class_CPUParticles2D_property_initial_velocity_random>` | 0.0 |
  91. +---------------------------------------------------------+---------------------------------------------------------------------------------------+---------------------+
  92. | :ref:`float<class_float>` | :ref:`lifetime<class_CPUParticles2D_property_lifetime>` | 1.0 |
  93. +---------------------------------------------------------+---------------------------------------------------------------------------------------+---------------------+
  94. | :ref:`float<class_float>` | :ref:`lifetime_randomness<class_CPUParticles2D_property_lifetime_randomness>` | 0.0 |
  95. +---------------------------------------------------------+---------------------------------------------------------------------------------------+---------------------+
  96. | :ref:`float<class_float>` | :ref:`linear_accel<class_CPUParticles2D_property_linear_accel>` | 0.0 |
  97. +---------------------------------------------------------+---------------------------------------------------------------------------------------+---------------------+
  98. | :ref:`Curve<class_Curve>` | :ref:`linear_accel_curve<class_CPUParticles2D_property_linear_accel_curve>` | |
  99. +---------------------------------------------------------+---------------------------------------------------------------------------------------+---------------------+
  100. | :ref:`float<class_float>` | :ref:`linear_accel_random<class_CPUParticles2D_property_linear_accel_random>` | 0.0 |
  101. +---------------------------------------------------------+---------------------------------------------------------------------------------------+---------------------+
  102. | :ref:`bool<class_bool>` | :ref:`local_coords<class_CPUParticles2D_property_local_coords>` | true |
  103. +---------------------------------------------------------+---------------------------------------------------------------------------------------+---------------------+
  104. | :ref:`Texture<class_Texture>` | :ref:`normalmap<class_CPUParticles2D_property_normalmap>` | |
  105. +---------------------------------------------------------+---------------------------------------------------------------------------------------+---------------------+
  106. | :ref:`bool<class_bool>` | :ref:`one_shot<class_CPUParticles2D_property_one_shot>` | false |
  107. +---------------------------------------------------------+---------------------------------------------------------------------------------------+---------------------+
  108. | :ref:`float<class_float>` | :ref:`orbit_velocity<class_CPUParticles2D_property_orbit_velocity>` | 0.0 |
  109. +---------------------------------------------------------+---------------------------------------------------------------------------------------+---------------------+
  110. | :ref:`Curve<class_Curve>` | :ref:`orbit_velocity_curve<class_CPUParticles2D_property_orbit_velocity_curve>` | |
  111. +---------------------------------------------------------+---------------------------------------------------------------------------------------+---------------------+
  112. | :ref:`float<class_float>` | :ref:`orbit_velocity_random<class_CPUParticles2D_property_orbit_velocity_random>` | 0.0 |
  113. +---------------------------------------------------------+---------------------------------------------------------------------------------------+---------------------+
  114. | :ref:`float<class_float>` | :ref:`preprocess<class_CPUParticles2D_property_preprocess>` | 0.0 |
  115. +---------------------------------------------------------+---------------------------------------------------------------------------------------+---------------------+
  116. | :ref:`float<class_float>` | :ref:`radial_accel<class_CPUParticles2D_property_radial_accel>` | 0.0 |
  117. +---------------------------------------------------------+---------------------------------------------------------------------------------------+---------------------+
  118. | :ref:`Curve<class_Curve>` | :ref:`radial_accel_curve<class_CPUParticles2D_property_radial_accel_curve>` | |
  119. +---------------------------------------------------------+---------------------------------------------------------------------------------------+---------------------+
  120. | :ref:`float<class_float>` | :ref:`radial_accel_random<class_CPUParticles2D_property_radial_accel_random>` | 0.0 |
  121. +---------------------------------------------------------+---------------------------------------------------------------------------------------+---------------------+
  122. | :ref:`float<class_float>` | :ref:`randomness<class_CPUParticles2D_property_randomness>` | 0.0 |
  123. +---------------------------------------------------------+---------------------------------------------------------------------------------------+---------------------+
  124. | :ref:`float<class_float>` | :ref:`scale_amount<class_CPUParticles2D_property_scale_amount>` | 1.0 |
  125. +---------------------------------------------------------+---------------------------------------------------------------------------------------+---------------------+
  126. | :ref:`Curve<class_Curve>` | :ref:`scale_amount_curve<class_CPUParticles2D_property_scale_amount_curve>` | |
  127. +---------------------------------------------------------+---------------------------------------------------------------------------------------+---------------------+
  128. | :ref:`float<class_float>` | :ref:`scale_amount_random<class_CPUParticles2D_property_scale_amount_random>` | 0.0 |
  129. +---------------------------------------------------------+---------------------------------------------------------------------------------------+---------------------+
  130. | :ref:`float<class_float>` | :ref:`speed_scale<class_CPUParticles2D_property_speed_scale>` | 1.0 |
  131. +---------------------------------------------------------+---------------------------------------------------------------------------------------+---------------------+
  132. | :ref:`float<class_float>` | :ref:`spread<class_CPUParticles2D_property_spread>` | 45.0 |
  133. +---------------------------------------------------------+---------------------------------------------------------------------------------------+---------------------+
  134. | :ref:`float<class_float>` | :ref:`tangential_accel<class_CPUParticles2D_property_tangential_accel>` | 0.0 |
  135. +---------------------------------------------------------+---------------------------------------------------------------------------------------+---------------------+
  136. | :ref:`Curve<class_Curve>` | :ref:`tangential_accel_curve<class_CPUParticles2D_property_tangential_accel_curve>` | |
  137. +---------------------------------------------------------+---------------------------------------------------------------------------------------+---------------------+
  138. | :ref:`float<class_float>` | :ref:`tangential_accel_random<class_CPUParticles2D_property_tangential_accel_random>` | 0.0 |
  139. +---------------------------------------------------------+---------------------------------------------------------------------------------------+---------------------+
  140. | :ref:`Texture<class_Texture>` | :ref:`texture<class_CPUParticles2D_property_texture>` | |
  141. +---------------------------------------------------------+---------------------------------------------------------------------------------------+---------------------+
  142. Methods
  143. -------
  144. +---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  145. | void | :ref:`convert_from_particles<class_CPUParticles2D_method_convert_from_particles>` **(** :ref:`Node<class_Node>` particles **)** |
  146. +---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  147. | :ref:`float<class_float>` | :ref:`get_param<class_CPUParticles2D_method_get_param>` **(** :ref:`Parameter<enum_CPUParticles2D_Parameter>` param **)** const |
  148. +---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  149. | :ref:`Curve<class_Curve>` | :ref:`get_param_curve<class_CPUParticles2D_method_get_param_curve>` **(** :ref:`Parameter<enum_CPUParticles2D_Parameter>` param **)** const |
  150. +---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  151. | :ref:`float<class_float>` | :ref:`get_param_randomness<class_CPUParticles2D_method_get_param_randomness>` **(** :ref:`Parameter<enum_CPUParticles2D_Parameter>` param **)** const |
  152. +---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  153. | :ref:`bool<class_bool>` | :ref:`get_particle_flag<class_CPUParticles2D_method_get_particle_flag>` **(** :ref:`Flags<enum_CPUParticles2D_Flags>` flag **)** const |
  154. +---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  155. | void | :ref:`restart<class_CPUParticles2D_method_restart>` **(** **)** |
  156. +---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  157. | void | :ref:`set_param<class_CPUParticles2D_method_set_param>` **(** :ref:`Parameter<enum_CPUParticles2D_Parameter>` param, :ref:`float<class_float>` value **)** |
  158. +---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  159. | void | :ref:`set_param_curve<class_CPUParticles2D_method_set_param_curve>` **(** :ref:`Parameter<enum_CPUParticles2D_Parameter>` param, :ref:`Curve<class_Curve>` curve **)** |
  160. +---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  161. | void | :ref:`set_param_randomness<class_CPUParticles2D_method_set_param_randomness>` **(** :ref:`Parameter<enum_CPUParticles2D_Parameter>` param, :ref:`float<class_float>` randomness **)** |
  162. +---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  163. | void | :ref:`set_particle_flag<class_CPUParticles2D_method_set_particle_flag>` **(** :ref:`Flags<enum_CPUParticles2D_Flags>` flag, :ref:`bool<class_bool>` enable **)** |
  164. +---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  165. Enumerations
  166. ------------
  167. .. _enum_CPUParticles2D_DrawOrder:
  168. .. _class_CPUParticles2D_constant_DRAW_ORDER_INDEX:
  169. .. _class_CPUParticles2D_constant_DRAW_ORDER_LIFETIME:
  170. enum **DrawOrder**:
  171. - **DRAW_ORDER_INDEX** = **0** --- Particles are drawn in the order emitted.
  172. - **DRAW_ORDER_LIFETIME** = **1** --- Particles are drawn in order of remaining lifetime.
  173. ----
  174. .. _enum_CPUParticles2D_Parameter:
  175. .. _class_CPUParticles2D_constant_PARAM_INITIAL_LINEAR_VELOCITY:
  176. .. _class_CPUParticles2D_constant_PARAM_ANGULAR_VELOCITY:
  177. .. _class_CPUParticles2D_constant_PARAM_ORBIT_VELOCITY:
  178. .. _class_CPUParticles2D_constant_PARAM_LINEAR_ACCEL:
  179. .. _class_CPUParticles2D_constant_PARAM_RADIAL_ACCEL:
  180. .. _class_CPUParticles2D_constant_PARAM_TANGENTIAL_ACCEL:
  181. .. _class_CPUParticles2D_constant_PARAM_DAMPING:
  182. .. _class_CPUParticles2D_constant_PARAM_ANGLE:
  183. .. _class_CPUParticles2D_constant_PARAM_SCALE:
  184. .. _class_CPUParticles2D_constant_PARAM_HUE_VARIATION:
  185. .. _class_CPUParticles2D_constant_PARAM_ANIM_SPEED:
  186. .. _class_CPUParticles2D_constant_PARAM_ANIM_OFFSET:
  187. .. _class_CPUParticles2D_constant_PARAM_MAX:
  188. enum **Parameter**:
  189. - **PARAM_INITIAL_LINEAR_VELOCITY** = **0** --- Use with :ref:`set_param<class_CPUParticles2D_method_set_param>`, :ref:`set_param_randomness<class_CPUParticles2D_method_set_param_randomness>`, and :ref:`set_param_curve<class_CPUParticles2D_method_set_param_curve>` to set initial velocity properties.
  190. - **PARAM_ANGULAR_VELOCITY** = **1** --- Use with :ref:`set_param<class_CPUParticles2D_method_set_param>`, :ref:`set_param_randomness<class_CPUParticles2D_method_set_param_randomness>`, and :ref:`set_param_curve<class_CPUParticles2D_method_set_param_curve>` to set angular velocity properties.
  191. - **PARAM_ORBIT_VELOCITY** = **2** --- Use with :ref:`set_param<class_CPUParticles2D_method_set_param>`, :ref:`set_param_randomness<class_CPUParticles2D_method_set_param_randomness>`, and :ref:`set_param_curve<class_CPUParticles2D_method_set_param_curve>` to set orbital velocity properties.
  192. - **PARAM_LINEAR_ACCEL** = **3** --- Use with :ref:`set_param<class_CPUParticles2D_method_set_param>`, :ref:`set_param_randomness<class_CPUParticles2D_method_set_param_randomness>`, and :ref:`set_param_curve<class_CPUParticles2D_method_set_param_curve>` to set linear acceleration properties.
  193. - **PARAM_RADIAL_ACCEL** = **4** --- Use with :ref:`set_param<class_CPUParticles2D_method_set_param>`, :ref:`set_param_randomness<class_CPUParticles2D_method_set_param_randomness>`, and :ref:`set_param_curve<class_CPUParticles2D_method_set_param_curve>` to set radial acceleration properties.
  194. - **PARAM_TANGENTIAL_ACCEL** = **5** --- Use with :ref:`set_param<class_CPUParticles2D_method_set_param>`, :ref:`set_param_randomness<class_CPUParticles2D_method_set_param_randomness>`, and :ref:`set_param_curve<class_CPUParticles2D_method_set_param_curve>` to set tangential acceleration properties.
  195. - **PARAM_DAMPING** = **6** --- Use with :ref:`set_param<class_CPUParticles2D_method_set_param>`, :ref:`set_param_randomness<class_CPUParticles2D_method_set_param_randomness>`, and :ref:`set_param_curve<class_CPUParticles2D_method_set_param_curve>` to set damping properties.
  196. - **PARAM_ANGLE** = **7** --- Use with :ref:`set_param<class_CPUParticles2D_method_set_param>`, :ref:`set_param_randomness<class_CPUParticles2D_method_set_param_randomness>`, and :ref:`set_param_curve<class_CPUParticles2D_method_set_param_curve>` to set angle properties.
  197. - **PARAM_SCALE** = **8** --- Use with :ref:`set_param<class_CPUParticles2D_method_set_param>`, :ref:`set_param_randomness<class_CPUParticles2D_method_set_param_randomness>`, and :ref:`set_param_curve<class_CPUParticles2D_method_set_param_curve>` to set scale properties.
  198. - **PARAM_HUE_VARIATION** = **9** --- Use with :ref:`set_param<class_CPUParticles2D_method_set_param>`, :ref:`set_param_randomness<class_CPUParticles2D_method_set_param_randomness>`, and :ref:`set_param_curve<class_CPUParticles2D_method_set_param_curve>` to set hue variation properties.
  199. - **PARAM_ANIM_SPEED** = **10** --- Use with :ref:`set_param<class_CPUParticles2D_method_set_param>`, :ref:`set_param_randomness<class_CPUParticles2D_method_set_param_randomness>`, and :ref:`set_param_curve<class_CPUParticles2D_method_set_param_curve>` to set animation speed properties.
  200. - **PARAM_ANIM_OFFSET** = **11** --- Use with :ref:`set_param<class_CPUParticles2D_method_set_param>`, :ref:`set_param_randomness<class_CPUParticles2D_method_set_param_randomness>`, and :ref:`set_param_curve<class_CPUParticles2D_method_set_param_curve>` to set animation offset properties.
  201. - **PARAM_MAX** = **12** --- Represents the size of the :ref:`Parameter<enum_CPUParticles2D_Parameter>` enum.
  202. ----
  203. .. _enum_CPUParticles2D_Flags:
  204. .. _class_CPUParticles2D_constant_FLAG_ALIGN_Y_TO_VELOCITY:
  205. .. _class_CPUParticles2D_constant_FLAG_ROTATE_Y:
  206. .. _class_CPUParticles2D_constant_FLAG_DISABLE_Z:
  207. .. _class_CPUParticles2D_constant_FLAG_MAX:
  208. enum **Flags**:
  209. - **FLAG_ALIGN_Y_TO_VELOCITY** = **0** --- Use with :ref:`set_particle_flag<class_CPUParticles2D_method_set_particle_flag>` to set :ref:`flag_align_y<class_CPUParticles2D_property_flag_align_y>`.
  210. - **FLAG_ROTATE_Y** = **1** --- Present for consistency with 3D particle nodes, not used in 2D.
  211. - **FLAG_DISABLE_Z** = **2** --- Present for consistency with 3D particle nodes, not used in 2D.
  212. - **FLAG_MAX** = **3** --- Represents the size of the :ref:`Flags<enum_CPUParticles2D_Flags>` enum.
  213. ----
  214. .. _enum_CPUParticles2D_EmissionShape:
  215. .. _class_CPUParticles2D_constant_EMISSION_SHAPE_POINT:
  216. .. _class_CPUParticles2D_constant_EMISSION_SHAPE_SPHERE:
  217. .. _class_CPUParticles2D_constant_EMISSION_SHAPE_RECTANGLE:
  218. .. _class_CPUParticles2D_constant_EMISSION_SHAPE_POINTS:
  219. .. _class_CPUParticles2D_constant_EMISSION_SHAPE_DIRECTED_POINTS:
  220. enum **EmissionShape**:
  221. - **EMISSION_SHAPE_POINT** = **0** --- All particles will be emitted from a single point.
  222. - **EMISSION_SHAPE_SPHERE** = **1** --- Particles will be emitted on the surface of a sphere flattened to two dimensions.
  223. - **EMISSION_SHAPE_RECTANGLE** = **2** --- Particles will be emitted in the area of a rectangle.
  224. - **EMISSION_SHAPE_POINTS** = **3** --- Particles will be emitted at a position chosen randomly among :ref:`emission_points<class_CPUParticles2D_property_emission_points>`. Particle color will be modulated by :ref:`emission_colors<class_CPUParticles2D_property_emission_colors>`.
  225. - **EMISSION_SHAPE_DIRECTED_POINTS** = **4** --- Particles will be emitted at a position chosen randomly among :ref:`emission_points<class_CPUParticles2D_property_emission_points>`. Particle velocity and rotation will be set based on :ref:`emission_normals<class_CPUParticles2D_property_emission_normals>`. Particle color will be modulated by :ref:`emission_colors<class_CPUParticles2D_property_emission_colors>`.
  226. Description
  227. -----------
  228. CPU-based 2D particle node used to create a variety of particle systems and effects.
  229. See also :ref:`Particles2D<class_Particles2D>`, which provides the same functionality with hardware acceleration, but may not run on older devices.
  230. Tutorials
  231. ---------
  232. - :doc:`../tutorials/2d/particle_systems_2d`
  233. Property Descriptions
  234. ---------------------
  235. .. _class_CPUParticles2D_property_amount:
  236. - :ref:`int<class_int>` **amount**
  237. +-----------+-------------------+
  238. | *Default* | 8 |
  239. +-----------+-------------------+
  240. | *Setter* | set_amount(value) |
  241. +-----------+-------------------+
  242. | *Getter* | get_amount() |
  243. +-----------+-------------------+
  244. Number of particles emitted in one emission cycle.
  245. ----
  246. .. _class_CPUParticles2D_property_angle:
  247. - :ref:`float<class_float>` **angle**
  248. +-----------+------------------+
  249. | *Default* | 0.0 |
  250. +-----------+------------------+
  251. | *Setter* | set_param(value) |
  252. +-----------+------------------+
  253. | *Getter* | get_param() |
  254. +-----------+------------------+
  255. Initial rotation applied to each particle, in degrees.
  256. ----
  257. .. _class_CPUParticles2D_property_angle_curve:
  258. - :ref:`Curve<class_Curve>` **angle_curve**
  259. +----------+------------------------+
  260. | *Setter* | set_param_curve(value) |
  261. +----------+------------------------+
  262. | *Getter* | get_param_curve() |
  263. +----------+------------------------+
  264. Each particle's rotation will be animated along this :ref:`Curve<class_Curve>`.
  265. ----
  266. .. _class_CPUParticles2D_property_angle_random:
  267. - :ref:`float<class_float>` **angle_random**
  268. +-----------+-----------------------------+
  269. | *Default* | 0.0 |
  270. +-----------+-----------------------------+
  271. | *Setter* | set_param_randomness(value) |
  272. +-----------+-----------------------------+
  273. | *Getter* | get_param_randomness() |
  274. +-----------+-----------------------------+
  275. Rotation randomness ratio.
  276. ----
  277. .. _class_CPUParticles2D_property_angular_velocity:
  278. - :ref:`float<class_float>` **angular_velocity**
  279. +-----------+------------------+
  280. | *Default* | 0.0 |
  281. +-----------+------------------+
  282. | *Setter* | set_param(value) |
  283. +-----------+------------------+
  284. | *Getter* | get_param() |
  285. +-----------+------------------+
  286. Initial angular velocity applied to each particle. Sets the speed of rotation of the particle.
  287. ----
  288. .. _class_CPUParticles2D_property_angular_velocity_curve:
  289. - :ref:`Curve<class_Curve>` **angular_velocity_curve**
  290. +----------+------------------------+
  291. | *Setter* | set_param_curve(value) |
  292. +----------+------------------------+
  293. | *Getter* | get_param_curve() |
  294. +----------+------------------------+
  295. Each particle's angular velocity will vary along this :ref:`Curve<class_Curve>`.
  296. ----
  297. .. _class_CPUParticles2D_property_angular_velocity_random:
  298. - :ref:`float<class_float>` **angular_velocity_random**
  299. +-----------+-----------------------------+
  300. | *Default* | 0.0 |
  301. +-----------+-----------------------------+
  302. | *Setter* | set_param_randomness(value) |
  303. +-----------+-----------------------------+
  304. | *Getter* | get_param_randomness() |
  305. +-----------+-----------------------------+
  306. Angular velocity randomness ratio.
  307. ----
  308. .. _class_CPUParticles2D_property_anim_offset:
  309. - :ref:`float<class_float>` **anim_offset**
  310. +-----------+------------------+
  311. | *Default* | 0.0 |
  312. +-----------+------------------+
  313. | *Setter* | set_param(value) |
  314. +-----------+------------------+
  315. | *Getter* | get_param() |
  316. +-----------+------------------+
  317. Particle animation offset.
  318. ----
  319. .. _class_CPUParticles2D_property_anim_offset_curve:
  320. - :ref:`Curve<class_Curve>` **anim_offset_curve**
  321. +----------+------------------------+
  322. | *Setter* | set_param_curve(value) |
  323. +----------+------------------------+
  324. | *Getter* | get_param_curve() |
  325. +----------+------------------------+
  326. Each particle's animation offset will vary along this :ref:`Curve<class_Curve>`.
  327. ----
  328. .. _class_CPUParticles2D_property_anim_offset_random:
  329. - :ref:`float<class_float>` **anim_offset_random**
  330. +-----------+-----------------------------+
  331. | *Default* | 0.0 |
  332. +-----------+-----------------------------+
  333. | *Setter* | set_param_randomness(value) |
  334. +-----------+-----------------------------+
  335. | *Getter* | get_param_randomness() |
  336. +-----------+-----------------------------+
  337. Animation offset randomness ratio.
  338. ----
  339. .. _class_CPUParticles2D_property_anim_speed:
  340. - :ref:`float<class_float>` **anim_speed**
  341. +-----------+------------------+
  342. | *Default* | 0.0 |
  343. +-----------+------------------+
  344. | *Setter* | set_param(value) |
  345. +-----------+------------------+
  346. | *Getter* | get_param() |
  347. +-----------+------------------+
  348. Particle animation speed.
  349. ----
  350. .. _class_CPUParticles2D_property_anim_speed_curve:
  351. - :ref:`Curve<class_Curve>` **anim_speed_curve**
  352. +----------+------------------------+
  353. | *Setter* | set_param_curve(value) |
  354. +----------+------------------------+
  355. | *Getter* | get_param_curve() |
  356. +----------+------------------------+
  357. Each particle's animation speed will vary along this :ref:`Curve<class_Curve>`.
  358. ----
  359. .. _class_CPUParticles2D_property_anim_speed_random:
  360. - :ref:`float<class_float>` **anim_speed_random**
  361. +-----------+-----------------------------+
  362. | *Default* | 0.0 |
  363. +-----------+-----------------------------+
  364. | *Setter* | set_param_randomness(value) |
  365. +-----------+-----------------------------+
  366. | *Getter* | get_param_randomness() |
  367. +-----------+-----------------------------+
  368. Animation speed randomness ratio.
  369. ----
  370. .. _class_CPUParticles2D_property_color:
  371. - :ref:`Color<class_Color>` **color**
  372. +-----------+---------------------+
  373. | *Default* | Color( 1, 1, 1, 1 ) |
  374. +-----------+---------------------+
  375. | *Setter* | set_color(value) |
  376. +-----------+---------------------+
  377. | *Getter* | get_color() |
  378. +-----------+---------------------+
  379. Each particle's initial color. If :ref:`texture<class_CPUParticles2D_property_texture>` is defined, it will be multiplied by this color.
  380. ----
  381. .. _class_CPUParticles2D_property_color_ramp:
  382. - :ref:`Gradient<class_Gradient>` **color_ramp**
  383. +----------+-----------------------+
  384. | *Setter* | set_color_ramp(value) |
  385. +----------+-----------------------+
  386. | *Getter* | get_color_ramp() |
  387. +----------+-----------------------+
  388. Each particle's color will vary along this :ref:`Gradient<class_Gradient>`.
  389. ----
  390. .. _class_CPUParticles2D_property_damping:
  391. - :ref:`float<class_float>` **damping**
  392. +-----------+------------------+
  393. | *Default* | 0.0 |
  394. +-----------+------------------+
  395. | *Setter* | set_param(value) |
  396. +-----------+------------------+
  397. | *Getter* | get_param() |
  398. +-----------+------------------+
  399. The rate at which particles lose velocity.
  400. ----
  401. .. _class_CPUParticles2D_property_damping_curve:
  402. - :ref:`Curve<class_Curve>` **damping_curve**
  403. +----------+------------------------+
  404. | *Setter* | set_param_curve(value) |
  405. +----------+------------------------+
  406. | *Getter* | get_param_curve() |
  407. +----------+------------------------+
  408. Damping will vary along this :ref:`Curve<class_Curve>`.
  409. ----
  410. .. _class_CPUParticles2D_property_damping_random:
  411. - :ref:`float<class_float>` **damping_random**
  412. +-----------+-----------------------------+
  413. | *Default* | 0.0 |
  414. +-----------+-----------------------------+
  415. | *Setter* | set_param_randomness(value) |
  416. +-----------+-----------------------------+
  417. | *Getter* | get_param_randomness() |
  418. +-----------+-----------------------------+
  419. Damping randomness ratio.
  420. ----
  421. .. _class_CPUParticles2D_property_direction:
  422. - :ref:`Vector2<class_Vector2>` **direction**
  423. +-----------+----------------------+
  424. | *Default* | Vector2( 1, 0 ) |
  425. +-----------+----------------------+
  426. | *Setter* | set_direction(value) |
  427. +-----------+----------------------+
  428. | *Getter* | get_direction() |
  429. +-----------+----------------------+
  430. Unit vector specifying the particles' emission direction.
  431. ----
  432. .. _class_CPUParticles2D_property_draw_order:
  433. - :ref:`DrawOrder<enum_CPUParticles2D_DrawOrder>` **draw_order**
  434. +-----------+-----------------------+
  435. | *Default* | 0 |
  436. +-----------+-----------------------+
  437. | *Setter* | set_draw_order(value) |
  438. +-----------+-----------------------+
  439. | *Getter* | get_draw_order() |
  440. +-----------+-----------------------+
  441. Particle draw order. Uses :ref:`DrawOrder<enum_CPUParticles2D_DrawOrder>` values.
  442. ----
  443. .. _class_CPUParticles2D_property_emission_colors:
  444. - :ref:`PoolColorArray<class_PoolColorArray>` **emission_colors**
  445. +----------+----------------------------+
  446. | *Setter* | set_emission_colors(value) |
  447. +----------+----------------------------+
  448. | *Getter* | get_emission_colors() |
  449. +----------+----------------------------+
  450. ----
  451. .. _class_CPUParticles2D_property_emission_normals:
  452. - :ref:`PoolVector2Array<class_PoolVector2Array>` **emission_normals**
  453. +----------+-----------------------------+
  454. | *Setter* | set_emission_normals(value) |
  455. +----------+-----------------------------+
  456. | *Getter* | get_emission_normals() |
  457. +----------+-----------------------------+
  458. ----
  459. .. _class_CPUParticles2D_property_emission_points:
  460. - :ref:`PoolVector2Array<class_PoolVector2Array>` **emission_points**
  461. +----------+----------------------------+
  462. | *Setter* | set_emission_points(value) |
  463. +----------+----------------------------+
  464. | *Getter* | get_emission_points() |
  465. +----------+----------------------------+
  466. ----
  467. .. _class_CPUParticles2D_property_emission_rect_extents:
  468. - :ref:`Vector2<class_Vector2>` **emission_rect_extents**
  469. +----------+----------------------------------+
  470. | *Setter* | set_emission_rect_extents(value) |
  471. +----------+----------------------------------+
  472. | *Getter* | get_emission_rect_extents() |
  473. +----------+----------------------------------+
  474. The rectangle's extents if :ref:`emission_shape<class_CPUParticles2D_property_emission_shape>` is set to :ref:`EMISSION_SHAPE_RECTANGLE<class_CPUParticles2D_constant_EMISSION_SHAPE_RECTANGLE>`.
  475. ----
  476. .. _class_CPUParticles2D_property_emission_shape:
  477. - :ref:`EmissionShape<enum_CPUParticles2D_EmissionShape>` **emission_shape**
  478. +-----------+---------------------------+
  479. | *Default* | 0 |
  480. +-----------+---------------------------+
  481. | *Setter* | set_emission_shape(value) |
  482. +-----------+---------------------------+
  483. | *Getter* | get_emission_shape() |
  484. +-----------+---------------------------+
  485. Particles will be emitted inside this region. See :ref:`EmissionShape<enum_CPUParticles2D_EmissionShape>` for possible values.
  486. ----
  487. .. _class_CPUParticles2D_property_emission_sphere_radius:
  488. - :ref:`float<class_float>` **emission_sphere_radius**
  489. +----------+-----------------------------------+
  490. | *Setter* | set_emission_sphere_radius(value) |
  491. +----------+-----------------------------------+
  492. | *Getter* | get_emission_sphere_radius() |
  493. +----------+-----------------------------------+
  494. The sphere's radius if :ref:`emission_shape<class_CPUParticles2D_property_emission_shape>` is set to :ref:`EMISSION_SHAPE_SPHERE<class_CPUParticles2D_constant_EMISSION_SHAPE_SPHERE>`.
  495. ----
  496. .. _class_CPUParticles2D_property_emitting:
  497. - :ref:`bool<class_bool>` **emitting**
  498. +-----------+---------------------+
  499. | *Default* | true |
  500. +-----------+---------------------+
  501. | *Setter* | set_emitting(value) |
  502. +-----------+---------------------+
  503. | *Getter* | is_emitting() |
  504. +-----------+---------------------+
  505. If ``true``, particles are being emitted.
  506. ----
  507. .. _class_CPUParticles2D_property_explosiveness:
  508. - :ref:`float<class_float>` **explosiveness**
  509. +-----------+--------------------------------+
  510. | *Default* | 0.0 |
  511. +-----------+--------------------------------+
  512. | *Setter* | set_explosiveness_ratio(value) |
  513. +-----------+--------------------------------+
  514. | *Getter* | get_explosiveness_ratio() |
  515. +-----------+--------------------------------+
  516. 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.
  517. ----
  518. .. _class_CPUParticles2D_property_fixed_fps:
  519. - :ref:`int<class_int>` **fixed_fps**
  520. +-----------+----------------------+
  521. | *Default* | 0 |
  522. +-----------+----------------------+
  523. | *Setter* | set_fixed_fps(value) |
  524. +-----------+----------------------+
  525. | *Getter* | get_fixed_fps() |
  526. +-----------+----------------------+
  527. 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 simulation of the particle system itself.
  528. ----
  529. .. _class_CPUParticles2D_property_flag_align_y:
  530. - :ref:`bool<class_bool>` **flag_align_y**
  531. +-----------+--------------------------+
  532. | *Default* | false |
  533. +-----------+--------------------------+
  534. | *Setter* | set_particle_flag(value) |
  535. +-----------+--------------------------+
  536. | *Getter* | get_particle_flag() |
  537. +-----------+--------------------------+
  538. Align Y axis of particle with the direction of its velocity.
  539. ----
  540. .. _class_CPUParticles2D_property_flatness:
  541. - :ref:`float<class_float>` **flatness**
  542. +-----------+---------------------+
  543. | *Default* | 0.0 |
  544. +-----------+---------------------+
  545. | *Setter* | set_flatness(value) |
  546. +-----------+---------------------+
  547. | *Getter* | get_flatness() |
  548. +-----------+---------------------+
  549. ----
  550. .. _class_CPUParticles2D_property_fract_delta:
  551. - :ref:`bool<class_bool>` **fract_delta**
  552. +-----------+-----------------------------+
  553. | *Default* | true |
  554. +-----------+-----------------------------+
  555. | *Setter* | set_fractional_delta(value) |
  556. +-----------+-----------------------------+
  557. | *Getter* | get_fractional_delta() |
  558. +-----------+-----------------------------+
  559. If ``true``, results in fractional delta calculation which has a smoother particles display effect.
  560. ----
  561. .. _class_CPUParticles2D_property_gravity:
  562. - :ref:`Vector2<class_Vector2>` **gravity**
  563. +-----------+--------------------+
  564. | *Default* | Vector2( 0, 98 ) |
  565. +-----------+--------------------+
  566. | *Setter* | set_gravity(value) |
  567. +-----------+--------------------+
  568. | *Getter* | get_gravity() |
  569. +-----------+--------------------+
  570. Gravity applied to every particle.
  571. ----
  572. .. _class_CPUParticles2D_property_hue_variation:
  573. - :ref:`float<class_float>` **hue_variation**
  574. +-----------+------------------+
  575. | *Default* | 0.0 |
  576. +-----------+------------------+
  577. | *Setter* | set_param(value) |
  578. +-----------+------------------+
  579. | *Getter* | get_param() |
  580. +-----------+------------------+
  581. Initial hue variation applied to each particle.
  582. ----
  583. .. _class_CPUParticles2D_property_hue_variation_curve:
  584. - :ref:`Curve<class_Curve>` **hue_variation_curve**
  585. +----------+------------------------+
  586. | *Setter* | set_param_curve(value) |
  587. +----------+------------------------+
  588. | *Getter* | get_param_curve() |
  589. +----------+------------------------+
  590. Each particle's hue will vary along this :ref:`Curve<class_Curve>`.
  591. ----
  592. .. _class_CPUParticles2D_property_hue_variation_random:
  593. - :ref:`float<class_float>` **hue_variation_random**
  594. +-----------+-----------------------------+
  595. | *Default* | 0.0 |
  596. +-----------+-----------------------------+
  597. | *Setter* | set_param_randomness(value) |
  598. +-----------+-----------------------------+
  599. | *Getter* | get_param_randomness() |
  600. +-----------+-----------------------------+
  601. Hue variation randomness ratio.
  602. ----
  603. .. _class_CPUParticles2D_property_initial_velocity:
  604. - :ref:`float<class_float>` **initial_velocity**
  605. +-----------+------------------+
  606. | *Default* | 0.0 |
  607. +-----------+------------------+
  608. | *Setter* | set_param(value) |
  609. +-----------+------------------+
  610. | *Getter* | get_param() |
  611. +-----------+------------------+
  612. Initial velocity magnitude for each particle. Direction comes from :ref:`spread<class_CPUParticles2D_property_spread>` and the node's orientation.
  613. ----
  614. .. _class_CPUParticles2D_property_initial_velocity_random:
  615. - :ref:`float<class_float>` **initial_velocity_random**
  616. +-----------+-----------------------------+
  617. | *Default* | 0.0 |
  618. +-----------+-----------------------------+
  619. | *Setter* | set_param_randomness(value) |
  620. +-----------+-----------------------------+
  621. | *Getter* | get_param_randomness() |
  622. +-----------+-----------------------------+
  623. Initial velocity randomness ratio.
  624. ----
  625. .. _class_CPUParticles2D_property_lifetime:
  626. - :ref:`float<class_float>` **lifetime**
  627. +-----------+---------------------+
  628. | *Default* | 1.0 |
  629. +-----------+---------------------+
  630. | *Setter* | set_lifetime(value) |
  631. +-----------+---------------------+
  632. | *Getter* | get_lifetime() |
  633. +-----------+---------------------+
  634. Amount of time each particle will exist.
  635. ----
  636. .. _class_CPUParticles2D_property_lifetime_randomness:
  637. - :ref:`float<class_float>` **lifetime_randomness**
  638. +-----------+--------------------------------+
  639. | *Default* | 0.0 |
  640. +-----------+--------------------------------+
  641. | *Setter* | set_lifetime_randomness(value) |
  642. +-----------+--------------------------------+
  643. | *Getter* | get_lifetime_randomness() |
  644. +-----------+--------------------------------+
  645. Particle lifetime randomness ratio.
  646. ----
  647. .. _class_CPUParticles2D_property_linear_accel:
  648. - :ref:`float<class_float>` **linear_accel**
  649. +-----------+------------------+
  650. | *Default* | 0.0 |
  651. +-----------+------------------+
  652. | *Setter* | set_param(value) |
  653. +-----------+------------------+
  654. | *Getter* | get_param() |
  655. +-----------+------------------+
  656. Linear acceleration applied to each particle in the direction of motion.
  657. ----
  658. .. _class_CPUParticles2D_property_linear_accel_curve:
  659. - :ref:`Curve<class_Curve>` **linear_accel_curve**
  660. +----------+------------------------+
  661. | *Setter* | set_param_curve(value) |
  662. +----------+------------------------+
  663. | *Getter* | get_param_curve() |
  664. +----------+------------------------+
  665. Each particle's linear acceleration will vary along this :ref:`Curve<class_Curve>`.
  666. ----
  667. .. _class_CPUParticles2D_property_linear_accel_random:
  668. - :ref:`float<class_float>` **linear_accel_random**
  669. +-----------+-----------------------------+
  670. | *Default* | 0.0 |
  671. +-----------+-----------------------------+
  672. | *Setter* | set_param_randomness(value) |
  673. +-----------+-----------------------------+
  674. | *Getter* | get_param_randomness() |
  675. +-----------+-----------------------------+
  676. Linear acceleration randomness ratio.
  677. ----
  678. .. _class_CPUParticles2D_property_local_coords:
  679. - :ref:`bool<class_bool>` **local_coords**
  680. +-----------+----------------------------------+
  681. | *Default* | true |
  682. +-----------+----------------------------------+
  683. | *Setter* | set_use_local_coordinates(value) |
  684. +-----------+----------------------------------+
  685. | *Getter* | get_use_local_coordinates() |
  686. +-----------+----------------------------------+
  687. If ``true``, particles use the parent node's coordinate space. If ``false``, they use global coordinates.
  688. ----
  689. .. _class_CPUParticles2D_property_normalmap:
  690. - :ref:`Texture<class_Texture>` **normalmap**
  691. +----------+----------------------+
  692. | *Setter* | set_normalmap(value) |
  693. +----------+----------------------+
  694. | *Getter* | get_normalmap() |
  695. +----------+----------------------+
  696. Normal map to be used for the :ref:`texture<class_CPUParticles2D_property_texture>` property.
  697. ----
  698. .. _class_CPUParticles2D_property_one_shot:
  699. - :ref:`bool<class_bool>` **one_shot**
  700. +-----------+---------------------+
  701. | *Default* | false |
  702. +-----------+---------------------+
  703. | *Setter* | set_one_shot(value) |
  704. +-----------+---------------------+
  705. | *Getter* | get_one_shot() |
  706. +-----------+---------------------+
  707. If ``true``, only one emission cycle occurs. If set ``true`` during a cycle, emission will stop at the cycle's end.
  708. ----
  709. .. _class_CPUParticles2D_property_orbit_velocity:
  710. - :ref:`float<class_float>` **orbit_velocity**
  711. +-----------+------------------+
  712. | *Default* | 0.0 |
  713. +-----------+------------------+
  714. | *Setter* | set_param(value) |
  715. +-----------+------------------+
  716. | *Getter* | get_param() |
  717. +-----------+------------------+
  718. Orbital velocity applied to each particle. Makes the particles circle around origin. Specified in number of full rotations around origin per second.
  719. ----
  720. .. _class_CPUParticles2D_property_orbit_velocity_curve:
  721. - :ref:`Curve<class_Curve>` **orbit_velocity_curve**
  722. +----------+------------------------+
  723. | *Setter* | set_param_curve(value) |
  724. +----------+------------------------+
  725. | *Getter* | get_param_curve() |
  726. +----------+------------------------+
  727. Each particle's orbital velocity will vary along this :ref:`Curve<class_Curve>`.
  728. ----
  729. .. _class_CPUParticles2D_property_orbit_velocity_random:
  730. - :ref:`float<class_float>` **orbit_velocity_random**
  731. +-----------+-----------------------------+
  732. | *Default* | 0.0 |
  733. +-----------+-----------------------------+
  734. | *Setter* | set_param_randomness(value) |
  735. +-----------+-----------------------------+
  736. | *Getter* | get_param_randomness() |
  737. +-----------+-----------------------------+
  738. Orbital velocity randomness ratio.
  739. ----
  740. .. _class_CPUParticles2D_property_preprocess:
  741. - :ref:`float<class_float>` **preprocess**
  742. +-----------+-----------------------------+
  743. | *Default* | 0.0 |
  744. +-----------+-----------------------------+
  745. | *Setter* | set_pre_process_time(value) |
  746. +-----------+-----------------------------+
  747. | *Getter* | get_pre_process_time() |
  748. +-----------+-----------------------------+
  749. Particle system starts as if it had already run for this many seconds.
  750. ----
  751. .. _class_CPUParticles2D_property_radial_accel:
  752. - :ref:`float<class_float>` **radial_accel**
  753. +-----------+------------------+
  754. | *Default* | 0.0 |
  755. +-----------+------------------+
  756. | *Setter* | set_param(value) |
  757. +-----------+------------------+
  758. | *Getter* | get_param() |
  759. +-----------+------------------+
  760. Radial acceleration applied to each particle. Makes particle accelerate away from origin.
  761. ----
  762. .. _class_CPUParticles2D_property_radial_accel_curve:
  763. - :ref:`Curve<class_Curve>` **radial_accel_curve**
  764. +----------+------------------------+
  765. | *Setter* | set_param_curve(value) |
  766. +----------+------------------------+
  767. | *Getter* | get_param_curve() |
  768. +----------+------------------------+
  769. Each particle's radial acceleration will vary along this :ref:`Curve<class_Curve>`.
  770. ----
  771. .. _class_CPUParticles2D_property_radial_accel_random:
  772. - :ref:`float<class_float>` **radial_accel_random**
  773. +-----------+-----------------------------+
  774. | *Default* | 0.0 |
  775. +-----------+-----------------------------+
  776. | *Setter* | set_param_randomness(value) |
  777. +-----------+-----------------------------+
  778. | *Getter* | get_param_randomness() |
  779. +-----------+-----------------------------+
  780. Radial acceleration randomness ratio.
  781. ----
  782. .. _class_CPUParticles2D_property_randomness:
  783. - :ref:`float<class_float>` **randomness**
  784. +-----------+-----------------------------+
  785. | *Default* | 0.0 |
  786. +-----------+-----------------------------+
  787. | *Setter* | set_randomness_ratio(value) |
  788. +-----------+-----------------------------+
  789. | *Getter* | get_randomness_ratio() |
  790. +-----------+-----------------------------+
  791. Emission lifetime randomness ratio.
  792. ----
  793. .. _class_CPUParticles2D_property_scale_amount:
  794. - :ref:`float<class_float>` **scale_amount**
  795. +-----------+------------------+
  796. | *Default* | 1.0 |
  797. +-----------+------------------+
  798. | *Setter* | set_param(value) |
  799. +-----------+------------------+
  800. | *Getter* | get_param() |
  801. +-----------+------------------+
  802. Initial scale applied to each particle.
  803. ----
  804. .. _class_CPUParticles2D_property_scale_amount_curve:
  805. - :ref:`Curve<class_Curve>` **scale_amount_curve**
  806. +----------+------------------------+
  807. | *Setter* | set_param_curve(value) |
  808. +----------+------------------------+
  809. | *Getter* | get_param_curve() |
  810. +----------+------------------------+
  811. Each particle's scale will vary along this :ref:`Curve<class_Curve>`.
  812. ----
  813. .. _class_CPUParticles2D_property_scale_amount_random:
  814. - :ref:`float<class_float>` **scale_amount_random**
  815. +-----------+-----------------------------+
  816. | *Default* | 0.0 |
  817. +-----------+-----------------------------+
  818. | *Setter* | set_param_randomness(value) |
  819. +-----------+-----------------------------+
  820. | *Getter* | get_param_randomness() |
  821. +-----------+-----------------------------+
  822. Scale randomness ratio.
  823. ----
  824. .. _class_CPUParticles2D_property_speed_scale:
  825. - :ref:`float<class_float>` **speed_scale**
  826. +-----------+------------------------+
  827. | *Default* | 1.0 |
  828. +-----------+------------------------+
  829. | *Setter* | set_speed_scale(value) |
  830. +-----------+------------------------+
  831. | *Getter* | get_speed_scale() |
  832. +-----------+------------------------+
  833. Particle system's running speed scaling ratio. A value of ``0`` can be used to pause the particles.
  834. ----
  835. .. _class_CPUParticles2D_property_spread:
  836. - :ref:`float<class_float>` **spread**
  837. +-----------+-------------------+
  838. | *Default* | 45.0 |
  839. +-----------+-------------------+
  840. | *Setter* | set_spread(value) |
  841. +-----------+-------------------+
  842. | *Getter* | get_spread() |
  843. +-----------+-------------------+
  844. Each particle's initial direction range from ``+spread`` to ``-spread`` degrees.
  845. ----
  846. .. _class_CPUParticles2D_property_tangential_accel:
  847. - :ref:`float<class_float>` **tangential_accel**
  848. +-----------+------------------+
  849. | *Default* | 0.0 |
  850. +-----------+------------------+
  851. | *Setter* | set_param(value) |
  852. +-----------+------------------+
  853. | *Getter* | get_param() |
  854. +-----------+------------------+
  855. Tangential acceleration applied to each particle. Tangential acceleration is perpendicular to the particle's velocity giving the particles a swirling motion.
  856. ----
  857. .. _class_CPUParticles2D_property_tangential_accel_curve:
  858. - :ref:`Curve<class_Curve>` **tangential_accel_curve**
  859. +----------+------------------------+
  860. | *Setter* | set_param_curve(value) |
  861. +----------+------------------------+
  862. | *Getter* | get_param_curve() |
  863. +----------+------------------------+
  864. Each particle's tangential acceleration will vary along this :ref:`Curve<class_Curve>`.
  865. ----
  866. .. _class_CPUParticles2D_property_tangential_accel_random:
  867. - :ref:`float<class_float>` **tangential_accel_random**
  868. +-----------+-----------------------------+
  869. | *Default* | 0.0 |
  870. +-----------+-----------------------------+
  871. | *Setter* | set_param_randomness(value) |
  872. +-----------+-----------------------------+
  873. | *Getter* | get_param_randomness() |
  874. +-----------+-----------------------------+
  875. Tangential acceleration randomness ratio.
  876. ----
  877. .. _class_CPUParticles2D_property_texture:
  878. - :ref:`Texture<class_Texture>` **texture**
  879. +----------+--------------------+
  880. | *Setter* | set_texture(value) |
  881. +----------+--------------------+
  882. | *Getter* | get_texture() |
  883. +----------+--------------------+
  884. Particle texture. If ``null``, particles will be squares.
  885. Method Descriptions
  886. -------------------
  887. .. _class_CPUParticles2D_method_convert_from_particles:
  888. - void **convert_from_particles** **(** :ref:`Node<class_Node>` particles **)**
  889. Sets this node's properties to match a given :ref:`Particles2D<class_Particles2D>` node with an assigned :ref:`ParticlesMaterial<class_ParticlesMaterial>`.
  890. ----
  891. .. _class_CPUParticles2D_method_get_param:
  892. - :ref:`float<class_float>` **get_param** **(** :ref:`Parameter<enum_CPUParticles2D_Parameter>` param **)** const
  893. ----
  894. .. _class_CPUParticles2D_method_get_param_curve:
  895. - :ref:`Curve<class_Curve>` **get_param_curve** **(** :ref:`Parameter<enum_CPUParticles2D_Parameter>` param **)** const
  896. ----
  897. .. _class_CPUParticles2D_method_get_param_randomness:
  898. - :ref:`float<class_float>` **get_param_randomness** **(** :ref:`Parameter<enum_CPUParticles2D_Parameter>` param **)** const
  899. ----
  900. .. _class_CPUParticles2D_method_get_particle_flag:
  901. - :ref:`bool<class_bool>` **get_particle_flag** **(** :ref:`Flags<enum_CPUParticles2D_Flags>` flag **)** const
  902. ----
  903. .. _class_CPUParticles2D_method_restart:
  904. - void **restart** **(** **)**
  905. Restarts the particle emitter.
  906. ----
  907. .. _class_CPUParticles2D_method_set_param:
  908. - void **set_param** **(** :ref:`Parameter<enum_CPUParticles2D_Parameter>` param, :ref:`float<class_float>` value **)**
  909. ----
  910. .. _class_CPUParticles2D_method_set_param_curve:
  911. - void **set_param_curve** **(** :ref:`Parameter<enum_CPUParticles2D_Parameter>` param, :ref:`Curve<class_Curve>` curve **)**
  912. ----
  913. .. _class_CPUParticles2D_method_set_param_randomness:
  914. - void **set_param_randomness** **(** :ref:`Parameter<enum_CPUParticles2D_Parameter>` param, :ref:`float<class_float>` randomness **)**
  915. ----
  916. .. _class_CPUParticles2D_method_set_particle_flag:
  917. - void **set_particle_flag** **(** :ref:`Flags<enum_CPUParticles2D_Flags>` flag, :ref:`bool<class_bool>` enable **)**