pub struct MouseState { /* private fields */ }
Expand description
Contains the state of the mouse in the current frame
Implementations§
Source§impl MouseState
impl MouseState
Gets the currently pressed buttons on the mouse
Sourcepub fn get_position(&self) -> (i32, i32)
pub fn get_position(&self) -> (i32, i32)
Gets the position (X, Y) of the cursor in the web_sys window
Sourcepub fn get_movement(&self) -> (i32, i32)
pub fn get_movement(&self) -> (i32, i32)
Gets the movement (X, Y) of the cursor between the last mouse event and the current one.
Sourcepub fn get_offset(&self) -> (i32, i32)
pub fn get_offset(&self) -> (i32, i32)
Gets the offset (X, Y) between of the cursor between the event which caused it and the padding edge of the target node.
Trait Implementations§
Source§impl Clone for MouseState
impl Clone for MouseState
Source§fn clone(&self) -> MouseState
fn clone(&self) -> MouseState
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreimpl Copy for MouseState
Auto Trait Implementations§
impl Freeze for MouseState
impl RefUnwindSafe for MouseState
impl Send for MouseState
impl Sync for MouseState
impl Unpin for MouseState
impl UnwindSafe for MouseState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more