pub struct Light { /* private fields */ }Expand description
A configurable radial-glow effect for egui.
Light paints soft, flickering motes — drifting haze or rising embers — on
an egui layer. It maintains its state between frames using egui’s temporary
data storage and never disturbs the host layout.
All motes are appended into a single triangle mesh per frame, so stacking order is preserved and the effect costs one shape.
Implementations§
Source§impl Light
impl Light
Sourcepub fn from_settings(
id_source: impl Hash + Debug,
settings: &LightSettings,
) -> Self
pub fn from_settings( id_source: impl Hash + Debug, settings: &LightSettings, ) -> Self
Builds a light effect from LightSettings.
Inverted ranges are normalized (swapped) so a host can never hand the spawner an empty range.
Sourcepub fn radius(self, range: RangeInclusive<f32>) -> Self
pub fn radius(self, range: RangeInclusive<f32>) -> Self
Sets the mote radius range (min..=max) in pixels.
Sourcepub fn intensity(self, intensity: f32) -> Self
pub fn intensity(self, intensity: f32) -> Self
Sets the global intensity multiplier in 0.0..=1.0.
Sourcepub fn motion(self, motion: LightMotion) -> Self
pub fn motion(self, motion: LightMotion) -> Self
Sets the motion model.
Sourcepub fn flicker(self, flicker: f32) -> Self
pub fn flicker(self, flicker: f32) -> Self
Sets the flicker depth in 0.0..=1.0 (0 disables flicker).
Sourcepub fn lifetime(self, range: RangeInclusive<f32>) -> Self
pub fn lifetime(self, range: RangeInclusive<f32>) -> Self
Sets the mote lifetime range (min..=max) in seconds.
Sourcepub fn on_foreground(self) -> Self
pub fn on_foreground(self) -> Self
Places the light on the Foreground layer.
Sourcepub fn on_background(self) -> Self
pub fn on_background(self) -> Self
Places the light 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 Light
impl RefUnwindSafe for Light
impl Send for Light
impl Sync for Light
impl Unpin for Light
impl UnsafeUnpin for Light
impl UnwindSafe for Light
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<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> ⓘ
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