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

Stores state and events of a button.

Fields§

§mouse_cursor_inside: bool

Whether mouse cursor is inside button.

§was_inside: bool

Whether mouse cursor was inside.

§pressed: bool

Whether button is pressed.

§pressed_instant: Option<Instant>

When button was pressed.

§events: Vec<ButtonEvent>

Stores button events.

Implementations§

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.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.