pub struct Window { /* private fields */ }appcore_linked or loaded only.Expand description
Window struct, represents a platform window.
Implementations§
Source§impl Window
impl Window
Sourcepub fn screen_width(&self) -> u32
pub fn screen_width(&self) -> u32
Get the window width (in screen coordinates).
Sourcepub fn screen_height(&self) -> u32
pub fn screen_height(&self) -> u32
Get the window height (in screen coordinates).
Sourcepub fn move_to(&self, x: i32, y: i32)
pub fn move_to(&self, x: i32, y: i32)
Move the window to a new position (in screen coordinates) relative to the top-left of the monitor area.
Sourcepub fn move_to_center(&self)
pub fn move_to_center(&self)
Move the window to the center of the monitor.
Sourcepub fn x(&self) -> i32
pub fn x(&self) -> i32
Get the x-position of the window (in screen coordinates) relative to the top-left of the monitor area.
Sourcepub fn y(&self) -> i32
pub fn y(&self) -> i32
Get the y-position of the window (in screen coordinates) relative to the top-left of the monitor area.
Sourcepub fn is_fullscreen(&self) -> bool
pub fn is_fullscreen(&self) -> bool
Whether or not the window is fullscreen.
Sourcepub fn set_cursor(&self, cursor: Cursor)
pub fn set_cursor(&self, cursor: Cursor)
Set the cursor.
Sourcepub fn is_visible(&self) -> bool
pub fn is_visible(&self) -> bool
Whether or not the window is currently visible (not hidden).
Sourcepub fn screen_to_pixels(&self, val: i32) -> i32
pub fn screen_to_pixels(&self, val: i32) -> i32
Convert screen coordinates to pixels using the current DPI scale.
Sourcepub fn pixels_to_screen(&self, val: i32) -> i32
pub fn pixels_to_screen(&self, val: i32) -> i32
Convert pixels to screen coordinates using the current DPI scale.
Sourcepub fn set_close_callback<F>(&self, callback: F)
pub fn set_close_callback<F>(&self, callback: F)
Called when the Window is closed.
§Callback Arguments
window: &Window- The window that fired the event (eg. self)
Sourcepub fn set_resize_callback<F>(&self, callback: F)
pub fn set_resize_callback<F>(&self, callback: F)
Called when the Window is resized.
§Callback Arguments
window: &Window- The window that fired the event (eg. self)width: u32- The new width of the window (in pixels)height: u32- The new height of the window (in pixels)