.. Generated automatically by doc/tools/makerst.py in Godot's source tree. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead. .. _class_Particles2D: Particles2D =========== **Inherits:** :ref:`Node2D` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` **Category:** Core Brief Description ----------------- 2D Particle emitter Member Functions ---------------- +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_amount` **(** **)** const | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Color` | :ref:`get_color` **(** **)** const | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Color` | :ref:`get_color_phase_color` **(** :ref:`int` phase **)** const | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_color_phase_pos` **(** :ref:`int` phase **)** const | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_color_phases` **(** **)** const | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`ColorRamp` | :ref:`get_color_ramp` **(** **)** const | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2` | :ref:`get_emission_half_extents` **(** **)** const | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2Array` | :ref:`get_emission_points` **(** **)** const | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2` | :ref:`get_emissor_offset` **(** **)** const | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_emit_timeout` **(** **)** const | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_explosiveness` **(** **)** const | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_h_frames` **(** **)** const | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2` | :ref:`get_initial_velocity` **(** **)** const | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_lifetime` **(** **)** const | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_param` **(** :ref:`int` param **)** const | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_pre_process_time` **(** **)** const | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_process_mode` **(** **)** const | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_randomness` **(** :ref:`int` param **)** const | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Texture` | :ref:`get_texture` **(** **)** const | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_time_scale` **(** **)** const | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_v_frames` **(** **)** const | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_emitting` **(** **)** const | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_flipped_h` **(** **)** const | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_flipped_v` **(** **)** const | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_using_local_space` **(** **)** const | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`pre_process` **(** :ref:`float` time **)** | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`reset` **(** **)** | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_amount` **(** :ref:`int` amount **)** | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_color` **(** :ref:`Color` color **)** | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_color_phase_color` **(** :ref:`int` phase, :ref:`Color` color **)** | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_color_phase_pos` **(** :ref:`int` phase, :ref:`float` pos **)** | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_color_phases` **(** :ref:`int` phases **)** | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`ColorRamp` | :ref:`set_color_ramp` **(** :ref:`Object` color_ramp **)** | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_emission_half_extents` **(** :ref:`Vector2` extents **)** | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_emission_points` **(** :ref:`Vector2Array` points **)** | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_emissor_offset` **(** :ref:`Vector2` offset **)** | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_emit_timeout` **(** :ref:`float` value **)** | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_emitting` **(** :ref:`bool` active **)** | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_explosiveness` **(** :ref:`float` amount **)** | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_flip_h` **(** :ref:`bool` enable **)** | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_flip_v` **(** :ref:`bool` enable **)** | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_h_frames` **(** :ref:`int` enable **)** | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_initial_velocity` **(** :ref:`Vector2` velocity **)** | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_lifetime` **(** :ref:`float` lifetime **)** | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_param` **(** :ref:`int` param, :ref:`float` value **)** | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_pre_process_time` **(** :ref:`float` time **)** | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_process_mode` **(** :ref:`int` mode **)** | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_randomness` **(** :ref:`int` param, :ref:`float` value **)** | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Texture` | :ref:`set_texture` **(** :ref:`Object` texture **)** | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_time_scale` **(** :ref:`float` time_scale **)** | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_use_local_space` **(** :ref:`bool` enable **)** | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_v_frames` **(** :ref:`int` enable **)** | +------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ Numeric Constants ----------------- - **PARAM_DIRECTION** = **0** --- Direction in degrees at which the particles will be launched, Notice that when the direction is set to 0 the particles will be launched to the negative - **PARAM_SPREAD** = **1** - **PARAM_LINEAR_VELOCITY** = **2** --- Velocity at which the particles will be launched. - **PARAM_SPIN_VELOCITY** = **3** --- The speed at which particles will spin around its own center. - **PARAM_ORBIT_VELOCITY** = **4** --- Velocity at which the particles will orbit around the emitter center - **PARAM_GRAVITY_DIRECTION** = **5** --- Direction in degrees at which the particles will be attracted - **PARAM_GRAVITY_STRENGTH** = **6** --- Strength of the gravitation attraction for each particle - **PARAM_RADIAL_ACCEL** = **7** - **PARAM_TANGENTIAL_ACCEL** = **8** - **PARAM_DAMPING** = **9** --- Amount of damping for each particle - **PARAM_INITIAL_ANGLE** = **10** --- Initial angle in radians at which each particle will be spawned - **PARAM_INITIAL_SIZE** = **11** --- Initial size of each particle - **PARAM_FINAL_SIZE** = **12** --- Final size of each particle, the particle size will interpolate to this value during its lifetime. - **PARAM_HUE_VARIATION** = **13** - **PARAM_ANIM_SPEED_SCALE** = **14** - **PARAM_ANIM_INITIAL_POS** = **15** - **PARAM_MAX** = **16** - **MAX_COLOR_PHASES** = **4** Description ----------- Particles2D is a particle system 2D :ref:`Node` that is used to simulate several types of particle effects, such as explosions, rain, snow, fireflies, or other magical-like shinny sparkles. Particles are drawn using impostors, and given their dynamic behavior, the user must provide a visibility bounding box (although helpers to create one automatically exist). Member Function Description --------------------------- .. _class_Particles2D_capture_rect: - :ref:`Rect2` **capture_rect** **(** **)** const .. _class_Particles2D_get_amount: - :ref:`int` **get_amount** **(** **)** const Returns the amount of particles spawned at each emission .. _class_Particles2D_get_draw_order: - :ref:`int` **get_draw_order** **(** **)** const .. _class_Particles2D_get_explosiveness_ratio: - :ref:`float` **get_explosiveness_ratio** **(** **)** const .. _class_Particles2D_get_fixed_fps: - :ref:`int` **get_fixed_fps** **(** **)** const .. _class_Particles2D_get_fractional_delta: - :ref:`bool` **get_fractional_delta** **(** **)** const .. _class_Particles2D_get_h_frames: - :ref:`int` **get_h_frames** **(** **)** const .. _class_Particles2D_get_lifetime: - :ref:`float` **get_lifetime** **(** **)** const Gets the amount of seconds that each particle will be visible. .. _class_Particles2D_get_normal_map: - :ref:`Texture` **get_normal_map** **(** **)** const .. _class_Particles2D_get_one_shot: - :ref:`bool` **get_one_shot** **(** **)** const .. _class_Particles2D_get_pre_process_time: - :ref:`float` **get_pre_process_time** **(** **)** const .. _class_Particles2D_get_process_mode: - :ref:`int` **get_process_mode** **(** **)** const .. _class_Particles2D_get_randomness: - :ref:`float` **get_randomness_ratio** **(** **)** const .. _class_Particles2D_get_speed_scale: - :ref:`float` **get_speed_scale** **(** **)** const .. _class_Particles2D_get_texture: - :ref:`Texture` **get_texture** **(** **)** const Returns the texture for emitted particles .. _class_Particles2D_get_use_local_coordinates: - :ref:`bool` **get_use_local_coordinates** **(** **)** const .. _class_Particles2D_get_v_frames: - :ref:`int` **get_v_frames** **(** **)** const .. _class_Particles2D_get_visibility_rect: - :ref:`Rect2` **get_visibility_rect** **(** **)** const .. _class_Particles2D_is_emitting: - :ref:`bool` **is_emitting** **(** **)** const Returns whether this emitter is currently emitting or not .. _class_Particles2D_restart: - void **restart** **(** **)** .. _class_Particles2D_set_amount: - void **set_amount** **(** :ref:`int` amount **)** Sets the amount of particles spawned at each emission .. _class_Particles2D_set_draw_order: - void **set_draw_order** **(** :ref:`int` order **)** .. _class_Particles2D_set_emitting: - void **set_emitting** **(** :ref:`bool` emitting **)** If this is set to true then the particle emitter will emit particles, if its false it will not. .. _class_Particles2D_set_explosiveness_ratio: - void **set_explosiveness_ratio** **(** :ref:`float` ratio **)** .. _class_Particles2D_set_fixed_fps: - void **set_fixed_fps** **(** :ref:`int` fps **)** .. _class_Particles2D_set_fractional_delta: - void **set_fractional_delta** **(** :ref:`bool` enable **)** .. _class_Particles2D_set_h_frames: - void **set_h_frames** **(** :ref:`int` frames **)** .. _class_Particles2D_set_lifetime: - void **set_lifetime** **(** :ref:`float` secs **)** Sets the amount of seconds that each particle will be visible. .. _class_Particles2D_set_normal_map: - void **set_normal_map** **(** :ref:`Texture` texture **)** .. _class_Particles2D_set_one_shot: - void **set_one_shot** **(** :ref:`bool` secs **)** .. _class_Particles2D_set_pre_process_time: .. _class_Particles2D_set_process_mode: - void **set_process_mode** **(** :ref:`int` mode **)** .. _class_Particles2D_set_randomness: .. _class_Particles2D_set_process_material: - void **set_process_material** **(** :ref:`Material` material **)** .. _class_Particles2D_set_randomness_ratio: - void **set_randomness_ratio** **(** :ref:`float` ratio **)** .. _class_Particles2D_set_speed_scale: - void **set_speed_scale** **(** :ref:`float` scale **)** .. _class_Particles2D_set_texture: - void **set_texture** **(** :ref:`Texture` texture **)** .. _class_Particles2D_set_use_local_coordinates: - void **set_use_local_coordinates** **(** :ref:`bool` enable **)** .. _class_Particles2D_set_v_frames: - void **set_v_frames** **(** :ref:`int` frames **)** .. _class_Particles2D_set_visibility_rect: - void **set_visibility_rect** **(** :ref:`Rect2` aabb **)**