Struct button_controller::ButtonController [] [src]

pub struct ButtonController {
    pub mouse_cursor_inside: bool,
    pub was_inside: bool,
    pub pressed: bool,
    pub pressed_instant: Option<Instant>,
    pub events: Vec<ButtonEvent>,
}

Stores state and events of a button.

Fields

Whether mouse cursor is inside button.

Whether mouse cursor was inside.

Whether button is pressed.

When button was pressed.

Stores button events.

Methods

impl ButtonController
[src]

Creates a new button controller.

Handles event.

Handle touch events.

Returns true if keep pressed appearance for some duration to give user feedback.

Returns the visual button state.