[−][src]Struct quicksilver::prelude::Window
The window currently in use
Methods
impl Window
[src]
pub fn clear_temporary_states(&mut self)
[src]
Transition temporary input states (Pressed, Released) into sustained ones (Held, NotPressed)
pub fn view(&self) -> View
[src]
Get the view from the window
pub fn set_view(&mut self, view: View)
[src]
Set the view the window uses
pub fn resize_strategy(&self) -> ResizeStrategy
[src]
Get the resize strategy used by the window
pub fn set_resize_strategy(&mut self, resize: ResizeStrategy)
[src]
Switch the strategy the window uses to display content when the available area changes
pub fn screen_size(&self) -> Vector
[src]
Get the screen size
pub fn unproject(&self) -> Transform
[src]
Get the unprojection matrix according to the View
pub fn project(&self) -> Transform
[src]
Get the projection matrix according to the View
pub fn keyboard(&self) -> &Keyboard
[src]
Get a reference to the keyboard
pub fn mouse(&self) -> Mouse
[src]
Get an instance of a mouse, projected into the current View
pub fn clear(&mut self, color: Color) -> Result<()>
[src]
Clear the screen to a given color
The blend mode is also automatically reset, and any un-flushed draw calls are dropped.
pub fn clear_letterbox_color(
&mut self,
color: Color,
letterbox: Color
) -> Result<()>
[src]
&mut self,
color: Color,
letterbox: Color
) -> Result<()>
Clear the screen to a given color, with a given letterbox color
The blend mode is also automatically reset, and any un-flushed draw calls are dropped.
pub fn flush(&mut self) -> Result<()>
[src]
Flush the current buffered draw calls
Attributes like z-ordering will be reset: all items drawn after a flush will always draw over all items drawn before a flush.
Note that calling this can be an expensive operation
pub fn set_blend_mode(&mut self, blend: BlendMode) -> Result<()>
[src]
Set the blend mode for the window
This will flush all of the drawn items to the screen and switch to the new blend mode.
pub fn reset_blend_mode(&mut self) -> Result<()>
[src]
Reset the blend mode for the window to the default alpha blending
This will flush all of the drawn items to the screen
pub fn gamepads(&self) -> &Vec<Gamepad>
[src]
Get a reference to the connected gamepads
pub fn draw<'a>(
&'a mut self,
draw: &impl Drawable,
bkg: impl Into<Background<'a>>
)
[src]
&'a mut self,
draw: &impl Drawable,
bkg: impl Into<Background<'a>>
)
Draw a Drawable to the window, which will be finalized on the next flush
pub fn draw_ex<'a>(
&'a mut self,
draw: &impl Drawable,
bkg: impl Into<Background<'a>>,
trans: Transform,
z: impl Scalar
)
[src]
&'a mut self,
draw: &impl Drawable,
bkg: impl Into<Background<'a>>,
trans: Transform,
z: impl Scalar
)
Draw a Drawable to the window with more options provided (draw exhaustive)
pub fn mesh(&mut self) -> &mut Mesh
[src]
The mesh the window uses to draw
pub fn update_rate(&self) -> f64
[src]
The ideal delay between two calls to update in milliseconds
pub fn set_update_rate(&mut self, update_rate: f64)
[src]
Set the desired time between two calls to update in milliseconds
pub fn draw_rate(&self) -> f64
[src]
The ideal delay between two calls to draw in milliseconds
pub fn set_draw_rate(&mut self, draw_rate: f64)
[src]
Set the desired time between two calls to draw in milliseconds
pub fn current_fps(&self) -> f64
[src]
Get the delay between the last two draw frames
pub fn average_fps(&self) -> f64
[src]
Get the average framerate over the history of the app
pub fn max_updates(&self) -> u32
[src]
Get the maximum number of updates that are allowed to run in a frame
0 means no limitation
pub fn set_max_updates(&mut self, max_updates: u32)
[src]
Set the maximum number of updates that are allowed to run in a frame
0 means no limitation
pub fn set_show_cursor(&mut self, show_cursor: bool)
[src]
please use set_cursor
instead
Set if the cursor should be visible when over the application
pub fn set_cursor(&mut self, cursor: MouseCursor)
[src]
Set current cursor
pub fn set_title(&mut self, title: &str)
[src]
Set the title of the window (or tab on mobile)
pub fn get_fullscreen(&self) -> bool
[src]
Get if the application is currently fullscreen
pub fn set_fullscreen(&mut self, fullscreen: bool)
[src]
Set if the application is currently fullscreen
pub fn set_size(&mut self, size: impl Into<Vector>)
[src]
Resize the window to the given size
pub fn close(&mut self)
[src]
Close the application without triggering the onclose handler
On desktop, this closes the window, and on the web it removes the canvas from the page
pub fn screenshot(&mut self, format: PixelFormat) -> DynamicImage
[src]
Create a screenshot as an image
If a surface is active, an image of that surface is generated. If no surface is activated,
an image of what has been drawn to the window is generated. Taking a screenshot in the
midst of a draw
call may have unexpected results.
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
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> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
T: Parameter<Self>,
Sets value
as a parameter of self
.
impl<T> Erased for T
impl<T> Same<T> for T
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> Downcast for T where
T: Any,
T: Any,