Struct leafwing_input_manager::action_state::ActionData
source · [−]pub struct ActionData {
pub state: ButtonState,
pub value: f32,
pub axis_pair: Option<DualAxisData>,
pub timing: Timing,
pub consumed: bool,
}Expand description
Metadata about an Actionlike action
If a button is released, its reasons_pressed should be empty.
Fields
state: ButtonStateIs the action pressed or released?
value: f32The “value” of the binding that triggered the action.
See [ActionState::action_value()] for more details.
Warning: this value may not be bounded as you might expect. Consider clamping this to account for multiple triggering inputs.
axis_pair: Option<DualAxisData>The [AxisPair] of the binding that triggered the action.
See [ActionState::action_axis_pair()] for more details.
timing: TimingWhen was the button pressed / released, and how long has it been held for?
consumed: boolWas this action consumed by ActionState::consume?
Actions that are consumed cannot be pressed again until they are explicitly released. This ensures that consumed actions are not immediately re-pressed by continued inputs.
Trait Implementations
sourceimpl Clone for ActionData
impl Clone for ActionData
sourcefn clone(&self) -> ActionData
fn clone(&self) -> ActionData
1.0.0 · sourceconst fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source. Read moresourceimpl Debug for ActionData
impl Debug for ActionData
sourceimpl Default for ActionData
impl Default for ActionData
sourcefn default() -> ActionData
fn default() -> ActionData
sourceimpl<'de> Deserialize<'de> for ActionData
impl<'de> Deserialize<'de> for ActionData
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
sourceimpl PartialEq<ActionData> for ActionData
impl PartialEq<ActionData> for ActionData
sourcefn eq(&self, other: &ActionData) -> bool
fn eq(&self, other: &ActionData) -> bool
sourceimpl Serialize for ActionData
impl Serialize for ActionData
impl StructuralPartialEq for ActionData
Auto Trait Implementations
impl RefUnwindSafe for ActionData
impl Send for ActionData
impl Sync for ActionData
impl Unpin for ActionData
impl UnwindSafe for ActionData
Blanket Implementations
impl<T, U> AsBindGroupShaderType<U> for Twhere
U: ShaderType,
&'a T: for<'a> Into<U>,
impl<T, U> AsBindGroupShaderType<U> for Twhere
U: ShaderType,
&'a T: for<'a> Into<U>,
fn as_bind_group_shader_type(
&self,
_images: &HashMap<Handle<Image>, <Image as RenderAsset>::PreparedAsset, RandomState, Global>
) -> U
fn as_bind_group_shader_type(
&self,
_images: &HashMap<Handle<Image>, <Image as RenderAsset>::PreparedAsset, RandomState, Global>
) -> U
T [ShaderType] for self. When used in [AsBindGroup]
derives, it is safe to assume that all images in self exist. Read moresourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait. Read morefn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read morefn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s. Read morefn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s. Read moreimpl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Self using data from the given [World]