pub struct Glass {
pub shapes: Vec<GlassShape>,
pub material: Material,
pub fuse: f32,
pub presence: f32,
pub darkness: f32,
pub shadow_boost: f32,
pub brightness: f32,
pub light_bend: f32,
/* private fields */
}Expand description
A glass element ready to paint with Painter::glass.
Call Context::prepare_glass before
painting, so the element adapts to what is behind it.
Fields§
§shapes: Vec<GlassShape>The shapes of the element. Usually one.
material: MaterialThe material.
fuse: f32Distance in points at which neighbouring shapes start to merge.
presence: f32How formed the element is, from 0 (absent) to 1. It scales the optics, not just the opacity, so glass appears by thickening.
darkness: f320 uses the light range of the material, 1 the dark range.
shadow_boost: f32Extra shadow over busy content.
brightness: f32Even brightening, used as press feedback.
light_bend: f32Extra rotation of the highlights, in radians.
Implementations§
Source§impl Glass
impl Glass
Sourcepub fn new(rect: Rect, corner: impl Into<Corner>, material: Material) -> Self
pub fn new(rect: Rect, corner: impl Into<Corner>, material: Material) -> Self
Creates an element of one shape.
Sourcepub fn group(shapes: Vec<GlassShape>, material: Material) -> Self
pub fn group(shapes: Vec<GlassShape>, material: Material) -> Self
Creates an element of several shapes that fuse where they come close.
Sourcepub fn presence(self, presence: f32) -> Self
pub fn presence(self, presence: f32) -> Self
Sets Glass::presence.
Sourcepub fn fuse(self, distance: f32) -> Self
pub fn fuse(self, distance: f32) -> Self
Sets Glass::fuse.
Sourcepub fn darkness(self, darkness: f32) -> Self
pub fn darkness(self, darkness: f32) -> Self
Sets Glass::darkness.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Glass
impl Freeze for Glass
impl Move for Glass
impl RefUnwindSafe for Glass
impl Send for Glass
impl Sync for Glass
impl Unpin for Glass
impl UnsafeUnpin for Glass
impl UnwindSafe for Glass
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.