[][src]Struct ggez::conf::WindowMode

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 hidpi: bool,
    pub resizable: bool,
}

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,
    hidpi: false,
    resizable: false,
}

Fields

width: f32

Window width

height: f32

Window height

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

hidpi: bool

Whether or not to scale all "pixel" coordinates to deal with high DPI screens.

A very good overview of this is available in the winit docs. If this is false (the default), one pixel in ggez equates to one physical pixel on the screen. If it is true, then ggez will scale all pixel coordinates by the scaling factor returned by graphics::get_hidpi_factor().

TODO: This is not implemented properly yet because winit is stubborn.

resizable: bool

Whether or not the window is resizable

Methods

impl WindowMode[src]

pub fn dimensions(self, width: f32, height: f32) -> Self[src]

Set default window size, or screen resolution in true fullscreen mode.

pub fn maximized(self, maximized: bool) -> Self[src]

Set whether the window should be maximized.

pub fn fullscreen_type(self, fullscreen_type: FullscreenType) -> Self[src]

Set the fullscreen type.

pub fn borderless(self, borderless: bool) -> Self[src]

Set whether a window should be borderless in windowed mode.

pub fn min_dimensions(self, width: f32, height: f32) -> Self[src]

Set minimum window dimensions for windowed mode.

pub fn max_dimensions(self, width: f32, height: f32) -> Self[src]

Set maximum window dimensions for windowed mode.

pub fn resizable(self, resizable: bool) -> Self[src]

Set resizable.

pub fn hidpi(self, hidpi: bool) -> Self[src]

Sets whether or not to allow hidpi.

Trait Implementations

impl PartialEq<WindowMode> for WindowMode[src]

impl Default for WindowMode[src]

fn default() -> Self[src]

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, hidpi: false, resizable: false }

impl Clone for WindowMode[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Copy for WindowMode[src]

impl Debug for WindowMode[src]

impl Serialize for WindowMode[src]

impl<'de> Deserialize<'de> for WindowMode[src]

Auto Trait Implementations

impl Send for WindowMode

impl Sync for WindowMode

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

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

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

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

The type returned in the event of a conversion error.

impl<T> Scalar for T where
    T: Copy + PartialEq<T> + Any + Debug
[src]

fn is<T>() -> bool where
    T: Scalar
[src]

Tests if Self the same as the type T Read more

impl<T> Same for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf for SP where
    SS: SubsetOf<SP>, 

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> Erased for T

impl<T> SetParameter for T

fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
    T: Parameter<Self>, 

Sets value as a parameter of self.