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 whether the window should be maximized.

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 resizable.

Set visibility

Set whether to resize when the hidpi factor changes

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Return WindowMode { width: 800.0, height: 600.0, maximized: false, fullscreen_type: FullscreenType :: Windowed, borderless: false, min_width: 0.0, min_height: 0.0, max_width: 0.0, max_height: 0.0, resizable: false, visible: true, resize_on_scale_factor_change: false }

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 !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.