Struct nannou::state::window::Window
[−]
[src]
pub struct Window<S = DefaultScalar> { pub id: Option<Id>, pub width: S, pub height: S, pub hidpi_factor: S, }
State of the window in focus.
Fields
id: Option<Id>
ID of the window currently in focus.
width: S
The width of the focused window agnostic of DPI.
This is equal to the pixel width divided by the hidpi_factor.
height: S
The height of the focused window agnostic of DPI.
This is equal to the pixel height divided by the hidpi_factor.
hidpi_factor: S
The high "dots-per-inch" multiplier that describes the density of the screens pixels.
Methods
impl<S> Window<S> where
S: BaseFloat,
[src]
S: BaseFloat,
pub fn new() -> Self
[src]
Initialise the window state.
pub fn x_range(&self) -> Range<S>
[src]
Get the range along the x axis occupied by the window.
pub fn y_range(&self) -> Range<S>
[src]
Get the range along the y axis occupied by the window.
pub fn rect(&self) -> Rect<S>
[src]
Get the x coordinate for the left edge of the window.
pub fn id(&self) -> Id
[src]
Expects that there will be a window::Id
(the common case) and **panic!**s otherwise.
pub fn size(&self) -> Vector2<S>
[src]
Return the width
and height
as a Vector2
.
Trait Implementations
impl<S: Copy> Copy for Window<S>
[src]
impl<S: Clone> Clone for Window<S>
[src]
fn clone(&self) -> Window<S>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<S: Debug> Debug for Window<S>
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more