pub struct DebugHud {
pub passes_label: Option<AssetId>,
pub mouse_label: Option<AssetId>,
pub camera_label: Option<AssetId>,
pub sys_label: Option<AssetId>,
}Expand description
Requests the developer debug HUD: a set of TextLabel chips with diagnostic readouts, anchored to the top-right of the window and toggled with F1 (hidden by default).
Each label field, when set, receives one chip: passes_label a multi-line
list of the heaviest rendering steps of the last frame, mouse_label the
cursor position in window pixels, camera_label the live camera pose
(position, yaw, pitch) in the exact form a fixed viewpoint is reproduced
with, and sys_label the worker-thread and host-memory budgets (the job
pool’s thread count, and the process resident set against the memory
budget). Chips whose stat is unavailable stay blank. The chips stack
vertically from the top-right corner in the order cursor, then camera, then
system, then passes (passes is last because its height varies with the
frame’s step count), so their on-screen position is fixed by the engine
rather than the authored coordinates.
The always-on frame-rate and GPU-memory readouts live on the separate StatHud.
Every rendering world receives a DebugHud and its chip labels at build
time when it declares none, so the example below is only needed to restyle
the chips. The HUD only activates in developer contexts: a debug build of
the host binary, or a world launched through cn debug; release builds
leave it inert even when declared. Declare an
EngineDefaults with "debug_hud": false to remove it
from the build entirely.
Fields§
§passes_label: Option<AssetId>TextLabel that receives the per-step GPU-timing chip text.
mouse_label: Option<AssetId>TextLabel that receives the cursor-position chip text.
camera_label: Option<AssetId>TextLabel that receives the live camera-pose chip text.
sys_label: Option<AssetId>TextLabel that receives the thread / memory budget chip text.
Trait Implementations§
Source§impl Component for DebugHud
impl Component for DebugHud
Source§fn from_baked(bytes: &[u8]) -> Result<DebugHud, CnResult>
fn from_baked(bytes: &[u8]) -> Result<DebugHud, 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 DebugHud
impl ComponentSlot for DebugHud
Source§const DISCRIMINANT: u8
const DISCRIMINANT: u8
ComponentId.Source§impl<'de> Deserialize<'de> for DebugHud
impl<'de> Deserialize<'de> for DebugHud
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<DebugHud, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<DebugHud, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl From<DebugHud> for ComponentAsset
impl From<DebugHud> for ComponentAsset
Source§fn from(c: DebugHud) -> ComponentAsset
fn from(c: DebugHud) -> ComponentAsset
impl RuntimeComponent for DebugHud
Source§impl Serialize for DebugHud
impl Serialize for DebugHud
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 DebugHud
impl RefUnwindSafe for DebugHud
impl Send for DebugHud
impl Sync for DebugHud
impl Unpin for DebugHud
impl UnsafeUnpin for DebugHud
impl UnwindSafe for DebugHud
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<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().