Struct amethyst_renderer::ScreenDimensions [−][src]
pub struct ScreenDimensions { /* fields omitted */ }World resource that stores screen dimensions.
Methods
impl ScreenDimensions[src]
impl ScreenDimensionspub fn new(w: u32, h: u32) -> ScreenDimensions[src]
pub fn new(w: u32, h: u32) -> ScreenDimensionsCreates a new screen dimensions object with the given width and height.
pub fn width(&self) -> f32[src]
pub fn width(&self) -> f32Returns 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.
pub fn height(&self) -> f32[src]
pub fn height(&self) -> f32Returns 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.
pub fn aspect_ratio(&self) -> f32[src]
pub fn aspect_ratio(&self) -> f32Returns the current aspect ratio of the window.
pub fn update(&mut self, w: u32, h: u32)[src]
pub fn update(&mut self, w: u32, h: u32)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]
impl Debug for ScreenDimensionsAuto Trait Implementations
impl Send for ScreenDimensions
impl Send for ScreenDimensionsimpl Sync for ScreenDimensions
impl Sync for ScreenDimensions