pub trait Input {
type Window: Drawer;
// Required methods
fn update(&mut self, drawer: &mut Self::Window);
fn is_mouse_down(&self) -> bool;
fn get_mouse_pos(&self) -> (usize, usize);
fn do_continue(&self) -> bool;
fn new() -> Self;
}
Expand description
Handles basic input
Required Associated Types§
Required Methods§
Sourcefn is_mouse_down(&self) -> bool
fn is_mouse_down(&self) -> bool
Checks to see if the mouse/pointer is down
Sourcefn get_mouse_pos(&self) -> (usize, usize)
fn get_mouse_pos(&self) -> (usize, usize)
Returns the current mouse position in a (x, y) tuple.
Sourcefn do_continue(&self) -> bool
fn do_continue(&self) -> bool
Checks to see if execution should be continued
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.