[][src]Struct amethyst_window::ScreenDimensions

pub struct ScreenDimensions { /* fields omitted */ }

World resource that stores screen dimensions.

Methods

impl ScreenDimensions[src]

pub fn new(w: u32, h: u32, hidpi: f64) -> Self[src]

Creates a new screen dimensions object with the given width and height.

pub fn diagonal(&self) -> Vector2<f32>[src]

Retursn the current logical size of window as diagonal vector.

pub fn width(&self) -> f32[src]

Returns the current logical width of the window.

pub fn height(&self) -> f32[src]

Returns the current logical height of the window.

pub fn aspect_ratio(&self) -> f32[src]

Returns the current aspect ratio of the window.

pub fn hidpi_factor(&self) -> f64[src]

Returns the ratio between the backing framebuffer resolution and the window size in screen pixels. This is typically one for a normal display and two for a retina display.

pub fn update(&mut self, w: f64, h: f64)[src]

Updates the width and height of the screen and recomputes the aspect ratio.

Only use this if you need to programmatically set the resolution of your game. This resource is updated automatically by the engine when a resize occurs so you don't need this unless you want to resize the game window.

pub fn update_hidpi_factor(&mut self, factor: f64)[src]

Updates the hidpi factor stored in this structure.

Amethyst will call this for you automatically, most engine users won't need this.

Trait Implementations

impl Clone for ScreenDimensions[src]

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

Performs copy-assignment from source. Read more

impl PartialEq<ScreenDimensions> for ScreenDimensions[src]

impl Debug for ScreenDimensions[src]

Auto Trait Implementations

Blanket Implementations

impl<T> From<T> for T[src]

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

type Owned = T

The resulting type after obtaining ownership.

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.

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

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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

impl<T> Resource for T where
    T: Any + Send + Sync

impl<T> Any for T where
    T: Any

impl<T> Erased for T

impl<T> Event for T where
    T: Send + Sync + 'static, 

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.