pub trait MouseProvider {
// Required methods
fn get_mouse_position(&self) -> Vector2;
fn mouse_button_down(&self, button: MouseButton) -> bool;
fn get_mouse_wheel_move_v(&self) -> Vector2;
}Expand description
Provides current-frame mouse state.
Required Methods§
Sourcefn get_mouse_position(&self) -> Vector2
fn get_mouse_position(&self) -> Vector2
Returns mouse position in pixel coordinates.
Returns whether the button is currently down.
Sourcefn get_mouse_wheel_move_v(&self) -> Vector2
fn get_mouse_wheel_move_v(&self) -> Vector2
Returns mouse wheel delta for the current frame.
By convention, x is horizontal scroll and y is vertical scroll.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl<T: MouseProvider> MouseProvider for Arc<T>
Delegates mouse access to the inner provider behind an Arc.
impl<T: MouseProvider> MouseProvider for Arc<T>
Delegates mouse access to the inner provider behind an Arc.
fn get_mouse_position(&self) -> Vector2
fn get_mouse_wheel_move_v(&self) -> Vector2
Source§impl<T: MouseProvider> MouseProvider for Mutex<T>
Delegates mouse access to the inner provider behind a Mutex.
impl<T: MouseProvider> MouseProvider for Mutex<T>
Delegates mouse access to the inner provider behind a Mutex.
§Panics
Panics if the mutex is poisoned.