pub struct ParticleSystem { /* private fields */ }Expand description
Particle system for visual effects.
Implementations§
Source§impl ParticleSystem
impl ParticleSystem
Sourcepub fn spawn(
&mut self,
x: f32,
y: f32,
count: usize,
speed: f32,
lifetime: f32,
size: f32,
color: u32,
)
pub fn spawn( &mut self, x: f32, y: f32, count: usize, speed: f32, lifetime: f32, size: f32, color: u32, )
Spawns particles at the given position.
§Arguments
x- X positiony- Y positioncount- Number of particles to spawnspeed- Base speed of particleslifetime- Base lifetime in secondssize- Base size (radius)color- Color as 0xRRGGBB
Sourcepub fn spawn_directional(
&mut self,
x: f32,
y: f32,
direction_x: f32,
direction_y: f32,
spread: f32,
count: usize,
speed: f32,
lifetime: f32,
size: f32,
color: u32,
)
pub fn spawn_directional( &mut self, x: f32, y: f32, direction_x: f32, direction_y: f32, spread: f32, count: usize, speed: f32, lifetime: f32, size: f32, color: u32, )
Spawns particles in a directional burst.
§Arguments
x- X positiony- Y positiondirection_x- Direction X componentdirection_y- Direction Y componentspread- Angular spread in radianscount- Number of particlesspeed- Base speedlifetime- Base lifetimesize- Base sizecolor- Color as 0xRRGGBB
Sourcepub fn get_active(&self) -> Vec<&Particle>
pub fn get_active(&self) -> Vec<&Particle>
Returns all active particles for rendering.
Sourcepub fn active_count(&self) -> usize
pub fn active_count(&self) -> usize
Returns the number of active particles.
Trait Implementations§
Source§impl Clone for ParticleSystem
impl Clone for ParticleSystem
Source§fn clone(&self) -> ParticleSystem
fn clone(&self) -> ParticleSystem
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ParticleSystem
impl Debug for ParticleSystem
Auto Trait Implementations§
impl Freeze for ParticleSystem
impl RefUnwindSafe for ParticleSystem
impl Send for ParticleSystem
impl Sync for ParticleSystem
impl Unpin for ParticleSystem
impl UnwindSafe for ParticleSystem
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more