pub struct WindowState { /* private fields */ }
Expand description
State of a window.
Implementations
sourceimpl WindowState
impl WindowState
sourcepub fn window_id(&self) -> BstWindowID
pub fn window_id(&self) -> BstWindowID
Returns the BstWindowID
this state corresponds to.
sourcepub fn is_focused(&self) -> bool
pub fn is_focused(&self) -> bool
Returns true
if the window is focused.
sourcepub fn is_cursor_inside(&self) -> bool
pub fn is_cursor_inside(&self) -> bool
Returns true
if the cursor is inside.
pub fn is_cursor_captured(&self) -> bool
sourcepub fn focused_bin_id(&self) -> Option<BinID>
pub fn focused_bin_id(&self) -> Option<BinID>
Returns the BinID
of the currently focused Bin
.
sourcepub fn cursor_pos(&self) -> [f32; 2]
pub fn cursor_pos(&self) -> [f32; 2]
Returns the current cursor position.
sourcepub fn is_key_pressed<K: Into<Key>>(&self, key: K) -> bool
pub fn is_key_pressed<K: Into<Key>>(&self, key: K) -> bool
Check if a Key
is pressed.
Supports using Qwerty
or MouseButton
.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for WindowState
impl Send for WindowState
impl Sync for WindowState
impl Unpin for WindowState
impl UnwindSafe for WindowState
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more