pub struct Snow { /* private fields */ }Expand description
A configurable snow effect for egui.
Snow allows you to add a falling snow animation to any egui layer or area.
It maintains its state between frames using egui’s temporary data storage.
Ported from egui-snow; the algorithm,
defaults and builders match upstream.
Implementations§
Source§impl Snow
impl Snow
Sourcepub fn from_settings(
id_source: impl Hash + Debug,
settings: &SnowSettings,
) -> Self
pub fn from_settings( id_source: impl Hash + Debug, settings: &SnowSettings, ) -> Self
Builds a snow effect from SnowSettings.
Inverted ranges are normalized (swapped) so a host can never hand the spawner an empty range.
Sourcepub fn speed(self, range: RangeInclusive<f32>) -> Self
pub fn speed(self, range: RangeInclusive<f32>) -> Self
Sets the falling speed range (min..=max) in pixels per second.
Sourcepub fn size(self, range: RangeInclusive<f32>) -> Self
pub fn size(self, range: RangeInclusive<f32>) -> Self
Sets the snowflake size range (min..=max).
Sourcepub fn on_foreground(self) -> Self
pub fn on_foreground(self) -> Self
Places the snow on the Foreground layer.
Sourcepub fn on_background(self) -> Self
pub fn on_background(self) -> Self
Places the snow on the Background layer.
Sourcepub fn layer(self, layer_id: LayerId) -> Self
pub fn layer(self, layer_id: LayerId) -> Self
Provides full control over the rendering layer.
This overrides on_top, on_foreground, and on_background.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Snow
impl RefUnwindSafe for Snow
impl Send for Snow
impl Sync for Snow
impl Unpin for Snow
impl UnsafeUnpin for Snow
impl UnwindSafe for Snow
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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