pub struct EngineDefaults {
pub hud: bool,
pub debug_hud: bool,
pub sky: bool,
pub story_pause_menu: bool,
pub loading_overlay: bool,
pub physics_config: bool,
}Expand description
Opts a world out of individual engine-injected defaults.
A world is completed at start with the standard components it does not
declare itself: the DebugHud with its chip
TextLabels and font, the chips and font of a
StatHud, the PhysicsConfig a world with
physics content simulates on, the LoadingOverlay a
streamed world waits behind, and, when an
EnvironmentMap is present, the sky mesh that displays
it. Declaring a piece yourself keeps the injection from filling that slot;
declaring EngineDefaults with a flag set to false removes the whole
default.
Two defaults are stated in terms of a MainMenu, which the
build expands away, so they are injected by the build instead: the
StatHud a menu world drives, and a story world’s pause menu.
EngineDefaults {
debug_hud: false,
sky: false,
..Default::default()
};Fields§
§hud: boolInject the StatHud when the world declares a
MainMenu but no StatHud, and fill any declared
StatHud’s unset chip labels with chips.
debug_hud: boolInject the DebugHud with its chip labels when the world
declares no DebugHud.
sky: boolInject the sky mesh (a skybox mesh, Material, and
Prop) when the world has an
EnvironmentMap but no skybox mesh. Disable to use an
EnvironmentMap for image-based lighting only, with the background
left to clear_color or your own geometry.
Inject an Escape-toggled pause MainMenu when the world
plays a Story but declares no MainMenu: Resume, Save, Load,
a trimmed Settings screen, and Quit to the story’s title. Disable to
leave a story with no pause menu, or declare your own MainMenu to
replace it.
loading_overlay: boolInject the LoadingOverlay with its screen, backdrop,
progress bar, and label when the world declares Scenes and a
StreamingConfig but no LoadingOverlay. Disable to
jump between scenes with no loading screen while their content streams
in.
physics_config: boolInject a PhysicsConfig with the engine’s own values
when the world has physics content – a RigidBody, a
PropBody, a TriggerVolume, or a
SkinnedMesh with a capsule – but declares no
PhysicsConfig. Physics runs on those values either way; the injected
component is what makes them visible to tooling. Disable to leave them
implicit.
Trait Implementations§
Source§impl Clone for EngineDefaults
impl Clone for EngineDefaults
Source§fn clone(&self) -> EngineDefaults
fn clone(&self) -> EngineDefaults
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 EngineDefaults
impl Component for EngineDefaults
Source§const NAME: &'static str = "EngineDefaults"
const NAME: &'static str = "EngineDefaults"
Source§fn from_baked(bytes: &[u8]) -> Result<EngineDefaults, CnResult>
fn from_baked(bytes: &[u8]) -> Result<EngineDefaults, 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 EngineDefaults
impl ComponentSlot for EngineDefaults
Source§const DISCRIMINANT: u8
const DISCRIMINANT: u8
ComponentId.Source§fn slot(s: &ComponentStorage) -> &Column<EngineDefaults>
fn slot(s: &ComponentStorage) -> &Column<EngineDefaults>
Source§fn slot_mut(s: &mut ComponentStorage) -> &mut Column<EngineDefaults>
fn slot_mut(s: &mut ComponentStorage) -> &mut Column<EngineDefaults>
Source§impl Debug for EngineDefaults
impl Debug for EngineDefaults
Source§impl Default for EngineDefaults
impl Default for EngineDefaults
Source§fn default() -> EngineDefaults
fn default() -> EngineDefaults
Source§impl<'de> Deserialize<'de> for EngineDefaultswhere
EngineDefaults: Default,
impl<'de> Deserialize<'de> for EngineDefaultswhere
EngineDefaults: Default,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<EngineDefaults, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<EngineDefaults, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for EngineDefaults
Source§impl From<EngineDefaults> for ComponentAsset
impl From<EngineDefaults> for ComponentAsset
Source§fn from(c: EngineDefaults) -> ComponentAsset
fn from(c: EngineDefaults) -> ComponentAsset
Source§impl PartialEq for EngineDefaults
impl PartialEq for EngineDefaults
impl RuntimeComponent for EngineDefaults
Source§impl Serialize for EngineDefaults
impl Serialize for EngineDefaults
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,
impl StructuralPartialEq for EngineDefaults
Auto Trait Implementations§
impl Freeze for EngineDefaults
impl RefUnwindSafe for EngineDefaults
impl Send for EngineDefaults
impl Sync for EngineDefaults
impl Unpin for EngineDefaults
impl UnsafeUnpin for EngineDefaults
impl UnwindSafe for EngineDefaults
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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 moreSource§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().