pub struct LoadingOverlay {
pub screen: Option<AssetId>,
pub backdrop: Option<AssetId>,
pub track: Option<AssetId>,
pub fill: Option<AssetId>,
pub label: Option<AssetId>,
}Expand description
Requests the scene-loading overlay: a full-window backdrop with a progress bar, shown while a scene jump waits for its streamed content and faded out once the destination scene is fully resident.
The overlay is assembled from ordinary UI elements the fields reference: a Screen that hosts them, a backdrop Sprite covering the canvas, a progress-bar track and fill Sprite pair, and a TextLabel above the bar. Each frame the engine widens the fill to the destination scene’s load progress and rewrites the label with the percentage; restyle any piece by declaring it yourself and pointing the overlay’s field at it.
While the overlay’s screen is up the world pauses and its render is skipped, exactly like an opaque menu, but streaming keeps running so the load it reports can finish. Scenes whose content is already resident jump without the overlay ever appearing.
Every rendering world that declares Scenes and a
StreamingConfig receives a LoadingOverlay at start
when it declares none, and any field left unset receives the piece it
names, so the example below is only needed to restyle them. Declare an
EngineDefaults with "loading_overlay": false to leave
the world without one.
Fields§
§screen: Option<AssetId>Screen the overlay shows while a scene loads. Its
pauses_world (on by default) freezes the world beneath the overlay so
the destination scene starts fresh when revealed.
backdrop: Option<AssetId>Backdrop Sprite covering the canvas. Its tint alpha is animated to reveal the scene once loading completes; an opaque tint hides the still-loading world completely.
track: Option<AssetId>Progress-bar track Sprite; its width is the bar’s full extent the fill is measured against.
fill: Option<AssetId>Progress-bar fill Sprite; the engine sets its width to the track width times the destination scene’s load progress each frame.
label: Option<AssetId>TextLabel rewritten each frame with the load percentage.
Trait Implementations§
Source§impl Authored for LoadingOverlay
impl Authored for LoadingOverlay
Source§impl Clone for LoadingOverlay
impl Clone for LoadingOverlay
Source§fn clone(&self) -> LoadingOverlay
fn clone(&self) -> LoadingOverlay
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Component for LoadingOverlay
impl Component for LoadingOverlay
Source§const NAME: &'static str = "LoadingOverlay"
const NAME: &'static str = "LoadingOverlay"
Source§fn from_baked(bytes: &[u8]) -> Result<LoadingOverlay, CnResult>
fn from_baked(bytes: &[u8]) -> Result<LoadingOverlay, CnResult>
Source§fn inject_locator(&mut self, _locator: PayloadLocator)
fn inject_locator(&mut self, _locator: PayloadLocator)
Source§fn inject_name(&mut self, _id: AssetId)
fn inject_name(&mut self, _id: AssetId)
Source§impl ComponentSlot for LoadingOverlay
impl ComponentSlot for LoadingOverlay
Source§const DISCRIMINANT: u8
const DISCRIMINANT: u8
ComponentId.Source§fn slot(s: &ComponentStorage) -> &Column<LoadingOverlay>
fn slot(s: &ComponentStorage) -> &Column<LoadingOverlay>
Source§fn slot_mut(s: &mut ComponentStorage) -> &mut Column<LoadingOverlay>
fn slot_mut(s: &mut ComponentStorage) -> &mut Column<LoadingOverlay>
Source§impl Debug for LoadingOverlay
impl Debug for LoadingOverlay
Source§impl Default for LoadingOverlay
impl Default for LoadingOverlay
Source§fn default() -> LoadingOverlay
fn default() -> LoadingOverlay
Source§impl<'de> Deserialize<'de> for LoadingOverlaywhere
LoadingOverlay: Default,
impl<'de> Deserialize<'de> for LoadingOverlaywhere
LoadingOverlay: Default,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<LoadingOverlay, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<LoadingOverlay, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl RuntimeComponent for LoadingOverlay
Source§impl Serialize for LoadingOverlay
impl Serialize for LoadingOverlay
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for LoadingOverlay
impl RefUnwindSafe for LoadingOverlay
impl Send for LoadingOverlay
impl Sync for LoadingOverlay
impl Unpin for LoadingOverlay
impl UnsafeUnpin for LoadingOverlay
impl UnwindSafe for LoadingOverlay
Blanket Implementations§
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
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> ⓘ
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