pub struct ParticleSystem {
pub transform: Transform2D,
pub alive: bool,
/* private fields */
}
Expand description
A ParticleSystem
deals with the emission, and creation of Particles
.
Fields§
§transform: Transform2D
The Transform2D
of the ParticleSystem
.
alive: bool
A ParticleSystem
needs to be alive to emit and update Particles
.
Implementations§
Source§impl ParticleSystem
impl ParticleSystem
Sourcepub fn new_from_emission(emission: ParticleProps) -> Self
pub fn new_from_emission(emission: ParticleProps) -> Self
Create a new ParticleSystem
using a ParticleProps
for the emission.
Sourcepub fn new_from_emission_and_position(
emission: ParticleProps,
pos_x: f32,
pos_y: f32,
) -> Self
pub fn new_from_emission_and_position( emission: ParticleProps, pos_x: f32, pos_y: f32, ) -> Self
Create a new ParticleSystem
using a ParticleProps
for the emission, and X
and Y
components for its position.
Sourcepub fn toggle_alive(&mut self)
pub fn toggle_alive(&mut self)
Toggle the alive
field of the ParticleSystem
.
Sourcepub fn emit(&mut self)
pub fn emit(&mut self)
Emit a single Particle
, according to the defined ParticleProps
for emission.
Sourcepub fn emit_many(&mut self, count: u32)
pub fn emit_many(&mut self, count: u32)
Emit multiple Particles
, according to the defined ParticleProps
for emission.
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 Component for ParticleSystem
impl Component for ParticleSystem
Source§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<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.