pub struct ParticleProps {
pub lifetime: f32,
pub velocity: Vec2,
pub velocity_modifier: Vec2,
pub color_start: Color32,
pub color_end: Color32,
pub color_modifier: Color32,
pub burst_count: u32,
pub size: Vec2,
}Expand description
A ParticleProps defines how Particles are created.
Reusing a ParticleProps allows for similar Particles to be emitted.
Fields§
§lifetime: f32How long the Particle will last.
velocity: Vec2The base velocity of the Particle.
velocity_modifier: Vec2A modifier field for the velocity of the Particle.
color_start: Color32The start color of the Particle.
color_end: Color32The end color of the Particle.
color_modifier: Color32A modifier field for the color of the Particle.
burst_count: u32How many Particles to emit on each update.
size: Vec2The size of the Particle.
Implementations§
Source§impl ParticleProps
impl ParticleProps
Sourcepub const fn fire() -> Self
pub const fn fire() -> Self
A Fire ParticleProps preset.
Sourcepub const fn smoke() -> Self
pub const fn smoke() -> Self
A Smoke ParticleProps preset.
Trait Implementations§
Source§impl Clone for ParticleProps
impl Clone for ParticleProps
Source§fn clone(&self) -> ParticleProps
fn clone(&self) -> ParticleProps
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 ParticleProps
impl Debug for ParticleProps
Source§impl Default for ParticleProps
impl Default for ParticleProps
Source§impl From<&ParticleProps> for Particle
impl From<&ParticleProps> for Particle
Source§fn from(properties: &ParticleProps) -> Self
fn from(properties: &ParticleProps) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ParticleProps
impl RefUnwindSafe for ParticleProps
impl Send for ParticleProps
impl Sync for ParticleProps
impl Unpin for ParticleProps
impl UnwindSafe for ParticleProps
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.