pub struct Emitter {Show 14 fields
pub origin: Option<EmitterOrigin>,
pub rate: f32,
pub life: EmitterRange,
pub direction: EmitterDirection,
pub speed: EmitterSpeed,
pub spawn_radius: EmitterRange,
pub shape: EmitterShape,
pub length: EmitterRange,
pub color: String,
pub width: f32,
pub seed: u64,
pub timing: TimingConfig,
pub style: CssStyle,
pub timeline: Vec<TimelineStep>,
}Expand description
A radial particle field with a real per-particle lifecycle: born, travelling, dying and immediately respawned, continuously, so the field at any instant is a mix of ages rather than one cohort.
Every particle’s state is derived in closed form from (seed, index, time) — nothing is simulated frame-to-frame — so any instant renders
independently and byte-identically no matter how it is reached
(render, still --time, or the same frame twice). Supersedes the
deprecated particle, whose fixed compositions had no lifecycle at
all.
Fields§
§origin: Option<EmitterOrigin>Point particles are born around, in the emitter’s own box, in pixels from its top-left corner. Defaults to the box centre.
rate: f32Average number of particles born per second. Combined with
life, this sets how many particles are alive at any instant
(concurrency = rate * average lifetime) — there is no separate
particle count to keep in sync by hand.
life: EmitterRangeLifetime range in seconds, [min, max]. Each particle draws its
own lifetime once, deterministically, from seed and its index.
direction: EmitterDirection§speed: EmitterSpeed§spawn_radius: EmitterRangeRing, in pixels from origin, particles are born on: [min, max].
shape: EmitterShape§length: EmitterRangeStreak length range in pixels, [min, max]. Unused when shape
is dot.
color: StringParticle color as a hex string.
width: f32Stroke width in pixels for a streak, diameter for a dot.
seed: u64Deterministic seed: the same seed and the same instant always paint the same pixels.
timing: TimingConfig§style: CssStyle§timeline: Vec<TimelineStep>Trait Implementations§
Source§impl Animatable for Emitter
impl Animatable for Emitter
fn animation_effects(&self) -> &[AnimationEffect]
fn timeline_steps(&self) -> &[TimelineStep]
Source§impl<'de> Deserialize<'de> for Emitter
impl<'de> Deserialize<'de> for Emitter
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for Emitter
impl JsonSchema for Emitter
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read moreSource§impl Painter for Emitter
impl Painter for Emitter
fn paint_content( &self, canvas: &Canvas, layout: &BoxLayout, _props: &AnimatedProperties, ctx: &PaintCtx, )
fn intrinsic_size( &self, _available: AvailableSize, _ctx: &MeasureCtx, ) -> Option<(f32, f32)>
Auto Trait Implementations§
impl Freeze for Emitter
impl RefUnwindSafe for Emitter
impl Send for Emitter
impl Sync for Emitter
impl Unpin for Emitter
impl UnsafeUnpin for Emitter
impl UnwindSafe for Emitter
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
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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> ⓘ
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> ⓘ
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