pub struct LightSettings {}Expand description
User-facing knobs for Light.
The defaults are deliberately neutral — a warm white, low density, wide soft radii, gentle flicker and multi-second lifetimes — so the effect can be tuned to a particular screen instead of shipping one screen’s look.
Fields§
§open: boolSettings-window visibility. Default false (the example opens it).
active: boolWhether the effect is drawn at all.
color: Color32Mote color.
density: usizeNumber of motes.
radius_min: f32Minimum mote radius in pixels.
radius_max: f32Maximum mote radius in pixels.
intensity: f32Global intensity multiplier in 0.0..=1.0.
motion: LightMotionMotion model.
wind: Vec2Global wind vector (x = horizontal, y = vertical).
flicker: f32Flicker depth in 0.0..=1.0 (0 disables flicker).
lifetime_min: f32Minimum mote lifetime in seconds.
lifetime_max: f32Maximum mote lifetime in seconds.
layer: ParticleLayerLayer the effect is painted on.
Implementations§
Source§impl LightSettings
impl LightSettings
Sourcepub fn reset(&mut self)
pub fn reset(&mut self)
Knobs back to defaults; open is preserved (a reset must not close the window).
Sourcepub fn show_window(&mut self, ctx: &Context) -> Option<Response>
pub fn show_window(&mut self, ctx: &Context) -> Option<Response>
Themed floating settings window; returns the window’s outer Response when open.
Window chrome plus a vertical scroll area around Self::body_ui, so a
viewport shorter than the controls scrolls instead of clipping them.
Sourcepub fn body_ui(&mut self, ui: &mut Ui)
pub fn body_ui(&mut self, ui: &mut Ui)
Draw the settings controls into ui — no window chrome.
Render them in your own container (egui::Window, SidePanel, ScrollArea, …)
instead of using Self::show_window. If that container can be shorter than the
controls, wrap it in an egui::ScrollArea.
Trait Implementations§
Source§impl Clone for LightSettings
impl Clone for LightSettings
Source§impl Debug for LightSettings
impl Debug for LightSettings
Source§impl Default for LightSettings
impl Default for LightSettings
Source§impl PartialEq for LightSettings
impl PartialEq for LightSettings
impl StructuralPartialEq for LightSettings
Auto Trait Implementations§
impl Freeze for LightSettings
impl RefUnwindSafe for LightSettings
impl Send for LightSettings
impl Sync for LightSettings
impl Unpin for LightSettings
impl UnsafeUnpin for LightSettings
impl UnwindSafe for LightSettings
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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