class_cpuparticles2d.rst 64 KB

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