Struct ggez::conf::WindowMode [−][src]
pub struct WindowMode {
pub width: f32,
pub height: f32,
pub maximized: bool,
pub fullscreen_type: FullscreenType,
pub borderless: bool,
pub min_width: f32,
pub min_height: f32,
pub max_width: f32,
pub max_height: f32,
pub resizable: bool,
pub visible: bool,
pub resize_on_scale_factor_change: bool,
}
Expand description
A builder structure containing window settings
that can be set at runtime and changed with graphics::set_mode()
.
Defaults:
WindowMode {
width: 800.0,
height: 600.0,
maximized: false,
fullscreen_type: FullscreenType::Windowed,
borderless: false,
min_width: 0.0,
max_width: 0.0,
min_height: 0.0,
max_height: 0.0,
resizable: false,
visible: true,
resize_on_scale_factor_change: false,
}
Fields
width: f32
Window width in physical pixels
height: f32
Window height in physical pixels
maximized: bool
Whether or not to maximize the window
fullscreen_type: FullscreenType
Fullscreen type
borderless: bool
Whether or not to show window decorations
min_width: f32
Minimum width for resizable windows; 0 means no limit
min_height: f32
Minimum height for resizable windows; 0 means no limit
max_width: f32
Maximum width for resizable windows; 0 means no limit
max_height: f32
Maximum height for resizable windows; 0 means no limit
resizable: bool
Whether or not the window is resizable
visible: bool
Whether this window should displayed (true) or hidden (false)
resize_on_scale_factor_change: bool
Whether this window should change its size in physical pixels
when its hidpi factor changes, i.e. when WindowEvent::ScaleFactorChanged
is fired.
You usually want this to be false, since the window suddenly changing size may break your game. Setting this to true may be desirable if you plan for it and want your window to behave like windows of other programs when being dragged from one screen to another, for example.
For more context on this take a look at this conversation.
Implementations
Set default window size, or screen resolution in true fullscreen mode.
Set the fullscreen type.
Set whether a window should be borderless in windowed mode.
Set minimum window dimensions for windowed mode.
Set maximum window dimensions for windowed mode.
Set whether to resize when the hidpi factor changes
Trait Implementations
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl RefUnwindSafe for WindowMode
impl Send for WindowMode
impl Sync for WindowMode
impl Unpin for WindowMode
impl UnwindSafe for WindowMode
Blanket Implementations
Mutably borrows from an owned value. Read more