Trait Input

Source
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§

Source

fn update(&mut self, drawer: &mut Self::Window)

Updates input

Source

fn is_mouse_down(&self) -> bool

Checks to see if the mouse/pointer is down

Source

fn get_mouse_pos(&self) -> (usize, usize)

Returns the current mouse position in a (x, y) tuple.

Source

fn do_continue(&self) -> bool

Checks to see if execution should be continued

Source

fn new() -> Self

Creates a new Input instance.

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.

Implementors§