Struct amethyst_renderer::ScreenDimensions [] [src]

pub struct ScreenDimensions { /* fields omitted */ }

World resource that stores screen dimensions.

Methods

impl ScreenDimensions
[src]

[src]

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

[src]

Returns the current width of the window.

This is returned as a float for user convenience, as this is typically used with other float values. This will only ever be a non-negative integer though.

[src]

Returns the current height of the window.

This is returned as a float for user convenience, as this is typically used with other float values. This will only ever be a non-negative integer though.

[src]

Returns the current aspect ratio of the window.

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

Trait Implementations

impl Debug for ScreenDimensions
[src]

[src]

Formats the value using the given formatter.