class

PointClickEngine::Graphics::Particles::Particle

Inherits Reference < Object

Individual particle with advanced properties

Constructors

new(position : RL::Vector2, velocity : RL::Vector2, size : Float32, color : RL::Color, lifetime : Float32)
Source

Instance methods

acceleration
Source
acceleration=(acceleration : RL::Vector2)
Source
age=(age : Float32)
Source
alive?

Check if particle is still alive

Source
alpha

Get current alpha

Source
bounce_factor
Source
bounce_factor=(bounce_factor : Float32)
Source
collision_enabled
Source
collision_enabled=(collision_enabled : Bool)
Source
color
Source
color=(color : RL::Color)
Source
draw

Draw the particle

Source
draw_with_context(context : PointClickEngine::Graphics::RenderContext)

Draw with render context (for culling)

Source
end_color
Source
end_color=(end_color : RL::Color)
Source
end_size
Source
end_size=(end_size : Float32)
Source
fade_in_time
Source
fade_in_time=(fade_in_time : Float32)
Source
fade_out_time
Source
fade_out_time=(fade_out_time : Float32)
Source
gravity_affected

Behavior flags

Source
gravity_affected=(gravity_affected : Bool)

Behavior flags

Source
lifetime

Lifetime

Source
lifetime=(lifetime : Float32)

Lifetime

Source
position

Position and movement

Source
position=(position : RL::Vector2)

Position and movement

Source
reset(position : RL::Vector2, velocity : RL::Vector2, size : Float32, color : RL::Color, lifetime : Float32)

Reset particle for pooling

Source
rotation
Source
rotation=(rotation : Float32)
Source
rotation_speed
Source
rotation_speed=(rotation_speed : Float32)
Source
size

Appearance

Source
size=(size : Float32)

Appearance

Source
start_color
Source
start_color=(start_color : RL::Color)
Source
start_size
Source
start_size=(start_size : Float32)
Source
texture

Texture support

Source
texture=(texture : RL::Texture2D | Nil)

Texture support

Source
texture_rect
Source
texture_rect=(texture_rect : RL::Rectangle | Nil)
Source
update(dt : Float32, gravity : RL::Vector2 | Nil = nil)

Update particle state

Source
velocity
Source
velocity=(velocity : RL::Vector2)
Source