Particles2D

Inherits: Node2D < CanvasItem < Node < Object

Category: Core

Brief Description

2D Particle emitter

Member Functions

int get_amount ( ) const
Color get_color ( ) const
Color get_color_phase_color ( int phase ) const
float get_color_phase_pos ( int phase ) const
int get_color_phases ( ) const
ColorRamp get_color_ramp ( ) const
Vector2 get_emission_half_extents ( ) const
Vector2Array get_emission_points ( ) const
Vector2 get_emissor_offset ( ) const
float get_emit_timeout ( ) const
float get_explosiveness ( ) const
int get_h_frames ( ) const
Vector2 get_initial_velocity ( ) const
float get_lifetime ( ) const
float get_param ( int param ) const
float get_pre_process_time ( ) const
int get_process_mode ( ) const
float get_randomness ( int param ) const
Texture get_texture ( ) const
float get_time_scale ( ) const
int get_v_frames ( ) const
bool is_emitting ( ) const
bool is_flipped_h ( ) const
bool is_flipped_v ( ) const
bool is_using_local_space ( ) const
void pre_process ( float time )
void reset ( )
void set_amount ( int amount )
void set_color ( Color color )
void set_color_phase_color ( int phase, Color color )
void set_color_phase_pos ( int phase, float pos )
void set_color_phases ( int phases )
ColorRamp set_color_ramp ( Object color_ramp )
void set_emission_half_extents ( Vector2 extents )
void set_emission_points ( Vector2Array points )
void set_emissor_offset ( Vector2 offset )
void set_emit_timeout ( float value )
void set_emitting ( bool active )
void set_explosiveness ( float amount )
void set_flip_h ( bool enable )
void set_flip_v ( bool enable )
void set_h_frames ( int enable )
void set_initial_velocity ( Vector2 velocity )
void set_lifetime ( float lifetime )
void set_param ( int param, float value )
void set_pre_process_time ( float time )
void set_process_mode ( int mode )
void set_randomness ( int param, float value )
Texture set_texture ( Object texture )
void set_time_scale ( float time_scale )
void set_use_local_space ( bool enable )
void set_v_frames ( 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 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

  • Rect2 capture_rect ( ) const
  • int get_amount ( ) const

Returns the amount of particles spawned at each emission

  • int get_draw_order ( ) const
  • float get_explosiveness_ratio ( ) const
  • int get_fixed_fps ( ) const
  • bool get_fractional_delta ( ) const
  • int get_h_frames ( ) const
  • float get_lifetime ( ) const

Gets the amount of seconds that each particle will be visible.

  • bool get_one_shot ( ) const
  • float get_pre_process_time ( ) const
  • int get_process_mode ( ) const
  • float get_randomness_ratio ( ) const
  • float get_speed_scale ( ) const

Returns the texture for emitted particles

  • bool get_use_local_coordinates ( ) const
  • int get_v_frames ( ) const
  • Rect2 get_visibility_rect ( ) const
  • bool is_emitting ( ) const

Returns whether this emitter is currently emitting or not

  • void restart ( )
  • void set_amount ( int amount )

Sets the amount of particles spawned at each emission

  • void set_draw_order ( int order )
  • void set_emitting ( bool emitting )

If this is set to true then the particle emitter will emit particles, if its false it will not.

  • void set_explosiveness_ratio ( float ratio )
  • void set_fixed_fps ( int fps )
  • void set_fractional_delta ( bool enable )
  • void set_h_frames ( int frames )
  • void set_lifetime ( float secs )

Sets the amount of seconds that each particle will be visible.

  • void set_normal_map ( Texture texture )
  • void set_one_shot ( bool secs )
  • void set_process_mode ( int mode )
  • void set_process_material ( Material material )
  • void set_randomness_ratio ( float ratio )
  • void set_speed_scale ( float scale )
  • void set_texture ( Texture texture )
  • void set_use_local_coordinates ( bool enable )
  • void set_v_frames ( int frames )
  • void set_visibility_rect ( Rect2 aabb )