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<Self, CnResult>
fn from_baked(bytes: &[u8]) -> Result<Self, 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.