pub struct PointBurstBuilder { /* private fields */ }Expand description
Simpler builder for particles bursting outward from a point.
ⓘ
let burst = PointBurstBuilder::new(320.0, 320.0)
.velocity(100.0)
.color(Color::ORANGE)
.build();Implementations§
Source§impl PointBurstBuilder
impl PointBurstBuilder
Sourcepub fn birth_rate(self, rate: f32) -> Self
pub fn birth_rate(self, rate: f32) -> Self
Set the number of particles spawned per second.
Sourcepub fn lifetime_range(self, range: f32) -> Self
pub fn lifetime_range(self, range: f32) -> Self
Set random variation in lifetime.
Sourcepub fn velocity_range(self, range: f64) -> Self
pub fn velocity_range(self, range: f64) -> Self
Set random variation in velocity.
Sourcepub fn scale_range(self, range: f64) -> Self
pub fn scale_range(self, range: f64) -> Self
Set random variation in scale.
Sourcepub fn scale_speed(self, speed: f64) -> Self
pub fn scale_speed(self, speed: f64) -> Self
Set rate of scale change per second.
Sourcepub fn alpha_speed(self, speed: f32) -> Self
pub fn alpha_speed(self, speed: f32) -> Self
Set rate of alpha change per second (negative = fade out).
Sourcepub fn color_rgba(self, r: f64, g: f64, b: f64, a: f64) -> Self
pub fn color_rgba(self, r: f64, g: f64, b: f64, a: f64) -> Self
Set particle color (RGBA, 0.0-1.0).
Sourcepub fn image(self, img: ParticleImage) -> Self
pub fn image(self, img: ParticleImage) -> Self
Set the particle image. Defaults to soft_glow(64) if not set.
Sourcepub fn render_mode(self, mode: RenderMode) -> Self
pub fn render_mode(self, mode: RenderMode) -> Self
Set the render mode. Defaults to Additive.
Sourcepub fn build(self) -> Retained<CAEmitterLayer> ⓘ
pub fn build(self) -> Retained<CAEmitterLayer> ⓘ
Build the CAEmitterLayer configured for point burst.
Auto Trait Implementations§
impl Freeze for PointBurstBuilder
impl RefUnwindSafe for PointBurstBuilder
impl Send for PointBurstBuilder
impl Sync for PointBurstBuilder
impl Unpin for PointBurstBuilder
impl UnwindSafe for PointBurstBuilder
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