Trait lux::interactive::Interactive [] [src]

pub trait Interactive {
    fn is_open(&mut self) -> bool;
    fn was_open(&self) -> bool;
    fn title(&self) -> &str;
    fn set_title(&mut self, title: &str);
    fn set_size(&mut self, width: u32, height: u32);
    fn get_size_u(&self) -> (u32, u32);
    fn is_focused(&self) -> bool;
    fn is_mouse_down(&self) -> bool;
    fn mouse_pos(&self) -> (Float, Float);
    fn mouse_pos_i(&self) -> (i32, i32);
    fn is_key_pressed<K: AbstractKey>(&self, k: K) -> bool;
    fn events(&mut self) -> EventIterator;

    fn get_size(&self) -> (f32, f32) { ... }
    fn width(&self) -> f32 { ... }
    fn height(&self) -> f32 { ... }
    fn width_u(&self) -> u32 { ... }
    fn height_u(&self) -> u32 { ... }
    fn mouse_x(&self) -> Float { ... }
    fn mouse_x_i(&self) -> i32 { ... }
    fn mouse_y(&self) -> Float { ... }
    fn mouse_y_i(&self) -> i32 { ... }
}

A trait for objects that are interactive to the user. The only known impelementation for this trait is the glutin Window.

Required Methods

Returns true if the window is not yet closed.

This function borrows self as &mut because it must process events before determining if it has closed before.

was_open is a similar function, but without the event processing. However, you should prefer is_open if at all possible.

Returns true if the window wasn't closed the last time that input was polled.

Returns the title of the object.

Sets the title of the object. If the object is a window, this title will be used to decorate the window.

Sets the size of the window if possible.

Returns the size of the window as an unsigned integer.

Returns true if the operating system has given this object focus.

Returns true if any mouse button is down.

Returns the current position of the mouse.

This function returns the position in floating point units for usability. Use mouse_pos_int if you want integer units.

Returns the current position of the mouse in integer units.

Returns true if a given key is currently being pressed.

Consumes all unseen events and returns them in an iterator.

Provided Methods

Returns the size of the window.

Returns the width of the window.

Returns the height of the window.

Returns the width of the window as an unsigned integer.

Returns the height of the window as an unsigned integer.

Returns the x coordinate of the mouse.

Returns the x coordinate of the mouse in integer units.

Returns the y coordinate of the mouse.

Returns the y coordinate of the mouse in integer units.

Implementors