pub struct Window {
pub title: String,
pub width: u32,
pub height: u32,
pub mode: WindowMode,
pub resizable: bool,
pub title_bar: bool,
}Expand description
Declares the application window.
{
"name": "main_window",
"type": "Window",
"args": {
"title": "Game",
"width": 1280,
"height": 720,
"mode": "windowed",
"resizable": true,
"title_bar": true
}
}Fields§
§title: StringWindow title shown in the title bar.
width: u32Initial window width in pixels.
height: u32Initial window height in pixels.
mode: WindowModeHow the window is displayed.
resizable: boolWhether the user can resize the window.
title_bar: boolWhether the title bar is drawn, letting content fill the frame when it
is not. Only applies to windowed mode: borderless has no title bar
by definition, and fullscreen leaves the chrome to the OS.
Platforms differ in what survives the title bar. macOS keeps the close / minimize / zoom buttons floating over the content, so the window stays movable and closable. Windows and Linux draw their controls in the title bar, so turning it off there also removes them: the window can still be resized from its border, but offers no close button and cannot be dragged.
Trait Implementations§
Source§impl Component for Window
impl Component for Window
Source§fn from_baked(bytes: &[u8]) -> Result<Window, CnResult>
fn from_baked(bytes: &[u8]) -> Result<Window, 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 Window
impl ComponentSlot for Window
Source§const DISCRIMINANT: u8
const DISCRIMINANT: u8
ComponentId.Source§impl<'de> Deserialize<'de> for Window
impl<'de> Deserialize<'de> for Window
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Window, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Window, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl From<Window> for ComponentAsset
impl From<Window> for ComponentAsset
Source§fn from(c: Window) -> ComponentAsset
fn from(c: Window) -> ComponentAsset
impl RuntimeComponent for Window
Source§impl Serialize for Window
impl Serialize for Window
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 Window
impl RefUnwindSafe for Window
impl Send for Window
impl Sync for Window
impl Unpin for Window
impl UnsafeUnpin for Window
impl UnwindSafe for Window
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().