pub struct Window(/* private fields */);Expand description
The window on the user’s desktop or in the browser tab
Implementations§
Source§impl Window
impl Window
Sourcepub fn set_cursor_icon(&self, icon: Option<CursorIcon>)
pub fn set_cursor_icon(&self, icon: Option<CursorIcon>)
Set the cursor icon to some value, or set it to invisible (None)
Sourcepub fn size(&self) -> Vector
pub fn size(&self) -> Vector
Get the size of the window in logical units
On a high-dpi display, this doesn’t correspond to physical pixels and must be multiplied by
scale_factor when passing sizes to functions like set_viewport
Sourcepub fn set_fullscreen(&self, fullscreen: bool)
pub fn set_fullscreen(&self, fullscreen: bool)
Set if the window should be fullscreen or not
On desktop, it will instantly become fullscreen (borderless windowed on Windows and Linux, and fullscreen on macOS). On web, it will become fullscreen after the next user interaction, due to browser API restrictions.
Sourcepub fn scale_factor(&self) -> f32
pub fn scale_factor(&self) -> f32
The DPI scale factor of the window
Mostly, this isn’t important to you. Some computer screens have more “physical” pixels than “logical” pixels, allowing them to draw sharper-looking images. Quicksilver abstracts this away. However, if you are manually setting the viewport, you need to take this into account.