pub struct ActionState {
pub kind: ActionKind,
pub mapping: Option<Button>,
pub disabled: bool,
pub pressed: bool,
}
Expand description
A rebindable action and its current state.
Fields§
§kind: ActionKind
How events are used to change the status of ActionState::pressed
.
mapping: Option<Button>
Button which triggers this action.
disabled: bool
If true, events are ignored, but unless the events time out, they will trigger the action once this is set to false again.
Can be used to e.g. disable jumping while in-air, but still cause a jump trigger if the player pressed the button right before landing.
pressed: bool
True if the action should be triggered based on input events, parsed
according to the action’s ActionKind
.
Trait Implementations§
Source§impl Clone for ActionState
impl Clone for ActionState
Source§fn clone(&self) -> ActionState
fn clone(&self) -> ActionState
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Default for ActionState
impl Default for ActionState
Source§fn default() -> ActionState
fn default() -> ActionState
Returns the “default value” for a type. Read more
impl Copy for ActionState
Auto Trait Implementations§
impl Freeze for ActionState
impl RefUnwindSafe for ActionState
impl Send for ActionState
impl Sync for ActionState
impl Unpin for ActionState
impl UnwindSafe for ActionState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more