[−][src]Struct amethyst_window::ScreenDimensions
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(&self) -> 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]
fn eq(&self, other: &ScreenDimensions) -> bool
[src]
fn ne(&self, other: &ScreenDimensions) -> bool
[src]
impl Debug for ScreenDimensions
[src]
Auto Trait Implementations
impl Unpin for ScreenDimensions
impl Sync for ScreenDimensions
impl Send for ScreenDimensions
impl UnwindSafe for ScreenDimensions
impl RefUnwindSafe for ScreenDimensions
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
[src]
fn is_in_subset(&self) -> bool
[src]
unsafe fn to_subset_unchecked(&self) -> SS
[src]
fn from_subset(element: &SS) -> SP
[src]
impl<T> Resource for T where
T: Any + Send + Sync,
[src]
T: Any + Send + Sync,
impl<T> Any for T where
T: Any,
[src]
T: Any,
fn get_type_id(&self) -> TypeId
[src]
impl<T> Event for T where
T: Send + Sync + 'static,
[src]
T: Send + Sync + 'static,