pub struct LoadingBarItem {
pub progress: f32,
pub label: Option<String>,
pub anchor: LoadingBarAnchor,
pub width_px: f32,
pub height_px: f32,
pub margin_px: f32,
pub background_colour: [f32; 4],
pub fill_colour: [f32; 4],
pub label_colour: [f32; 4],
pub font_size: f32,
pub corner_radius: f32,
}Expand description
A progress bar drawn over the viewport in screen space.
Render via OverlayFrame::loading_bars.
use viewport_lib::{LoadingBarItem, LoadingBarAnchor};
let bar = LoadingBarItem {
progress: 0.42,
label: Some("Building scene… 420 000 / 1 000 000".into()),
anchor: LoadingBarAnchor::BottomCenter,
..LoadingBarItem::default()
};Fields§
§progress: f32Progress fraction in [0.0, 1.0].
label: Option<String>Optional label displayed above (or below for TopCenter) the bar.
anchor: LoadingBarAnchorViewport anchor for the bar.
width_px: f32Bar width in logical pixels.
height_px: f32Bar height in logical pixels.
margin_px: f32Distance from the anchored viewport edge in logical pixels.
background_colour: [f32; 4]Background (unfilled) colour.
fill_colour: [f32; 4]Fill (progress) colour.
label_colour: [f32; 4]Label text colour.
font_size: f32Font size for the label in logical pixels.
corner_radius: f32Corner radius of the bar rectangles in logical pixels.
Trait Implementations§
Source§impl Clone for LoadingBarItem
impl Clone for LoadingBarItem
Source§fn clone(&self) -> LoadingBarItem
fn clone(&self) -> LoadingBarItem
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LoadingBarItem
impl Debug for LoadingBarItem
Auto Trait Implementations§
impl Freeze for LoadingBarItem
impl RefUnwindSafe for LoadingBarItem
impl Send for LoadingBarItem
impl Sync for LoadingBarItem
impl Unpin for LoadingBarItem
impl UnsafeUnpin for LoadingBarItem
impl UnwindSafe for LoadingBarItem
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
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>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn 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>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which 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)
Converts
&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)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.