Struct leafwing_input_manager::axislike::VirtualDPad
source · pub struct VirtualDPad {
pub up: InputKind,
pub down: InputKind,
pub left: InputKind,
pub right: InputKind,
}Expand description
A virtual DPad that you can get an DualAxis from.
Typically, you don’t want to store a DualAxis in this type,
even though it can be stored as an InputKind.
Instead, use it directly as InputKind::DualAxis!
Fields§
§up: InputKindThe input that represents the up direction in this virtual DPad
down: InputKindThe input that represents the down direction in this virtual DPad
left: InputKindThe input that represents the left direction in this virtual DPad
right: InputKindThe input that represents the right direction in this virtual DPad
Implementations§
source§impl VirtualDPad
impl VirtualDPad
sourcepub const fn arrow_keys() -> VirtualDPad
pub const fn arrow_keys() -> VirtualDPad
Generates a VirtualDPad corresponding to the arrow keyboard keycodes
sourcepub const fn wasd() -> VirtualDPad
pub const fn wasd() -> VirtualDPad
Generates a VirtualDPad corresponding to the WASD keys on the standard US QWERTY layout.
Note that on other keyboard layouts, different keys need to be pressed. The location of the keys is the same on all keyboard layouts. This ensures that the classic triangular shape is retained on all layouts, which enables comfortable movement controls.
sourcepub const fn dpad() -> VirtualDPad
pub const fn dpad() -> VirtualDPad
Generates a VirtualDPad corresponding to the DPad on a gamepad
Generates a VirtualDPad corresponding to the face buttons on a gamepad
North corresponds to up, west corresponds to left, east corresponds to right, south corresponds to down
sourcepub const fn mouse_wheel() -> VirtualDPad
pub const fn mouse_wheel() -> VirtualDPad
Generates a VirtualDPad corresponding to discretized mousewheel movements
sourcepub const fn mouse_motion() -> VirtualDPad
pub const fn mouse_motion() -> VirtualDPad
Generates a VirtualDPad corresponding to discretized mouse motions
sourcepub fn inverted_y(self) -> Self
pub fn inverted_y(self) -> Self
Returns this VirtualDPad but with up and down swapped.
sourcepub fn inverted_x(self) -> Self
pub fn inverted_x(self) -> Self
Returns this VirtualDPad but with left and right swapped.
sourcepub fn inverted(self) -> Self
pub fn inverted(self) -> Self
Returns this VirtualDPad but with inverted inputs.
Trait Implementations§
source§impl Clone for VirtualDPad
impl Clone for VirtualDPad
source§fn clone(&self) -> VirtualDPad
fn clone(&self) -> VirtualDPad
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for VirtualDPad
impl Debug for VirtualDPad
source§impl<'de> Deserialize<'de> for VirtualDPad
impl<'de> Deserialize<'de> for VirtualDPad
source§fn 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>,
source§impl From<VirtualDPad> for UserInput
impl From<VirtualDPad> for UserInput
source§fn from(input: VirtualDPad) -> Self
fn from(input: VirtualDPad) -> Self
source§impl FromReflect for VirtualDPad
impl FromReflect for VirtualDPad
source§fn from_reflect(reflect: &dyn Reflect) -> Option<Self>
fn from_reflect(reflect: &dyn Reflect) -> Option<Self>
Self from a reflected value.§fn take_from_reflect(
reflect: Box<dyn Reflect>
) -> Result<Self, Box<dyn Reflect>>
fn take_from_reflect( reflect: Box<dyn Reflect> ) -> Result<Self, Box<dyn Reflect>>
Self using,
constructing the value using from_reflect if that fails. Read moresource§impl GetTypeRegistration for VirtualDPad
impl GetTypeRegistration for VirtualDPad
fn get_type_registration() -> TypeRegistration
source§impl Hash for VirtualDPad
impl Hash for VirtualDPad
source§impl PartialEq for VirtualDPad
impl PartialEq for VirtualDPad
source§fn eq(&self, other: &VirtualDPad) -> bool
fn eq(&self, other: &VirtualDPad) -> bool
self and other values to be equal, and is used
by ==.source§impl Reflect for VirtualDPad
impl Reflect for VirtualDPad
source§fn get_represented_type_info(&self) -> Option<&'static TypeInfo>
fn get_represented_type_info(&self) -> Option<&'static TypeInfo>
TypeInfo] of the type represented by this value. Read moresource§fn as_any_mut(&mut self) -> &mut dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
&mut dyn Any.source§fn into_reflect(self: Box<Self>) -> Box<dyn Reflect>
fn into_reflect(self: Box<Self>) -> Box<dyn Reflect>
source§fn as_reflect(&self) -> &dyn Reflect
fn as_reflect(&self) -> &dyn Reflect
source§fn as_reflect_mut(&mut self) -> &mut dyn Reflect
fn as_reflect_mut(&mut self) -> &mut dyn Reflect
source§fn clone_value(&self) -> Box<dyn Reflect>
fn clone_value(&self) -> Box<dyn Reflect>
Reflect trait object. Read moresource§fn set(&mut self, value: Box<dyn Reflect>) -> Result<(), Box<dyn Reflect>>
fn set(&mut self, value: Box<dyn Reflect>) -> Result<(), Box<dyn Reflect>>
source§fn reflect_kind(&self) -> ReflectKind
fn reflect_kind(&self) -> ReflectKind
source§fn reflect_ref(&self) -> ReflectRef<'_>
fn reflect_ref(&self) -> ReflectRef<'_>
source§fn reflect_mut(&mut self) -> ReflectMut<'_>
fn reflect_mut(&mut self) -> ReflectMut<'_>
source§fn reflect_owned(self: Box<Self>) -> ReflectOwned
fn reflect_owned(self: Box<Self>) -> ReflectOwned
source§fn reflect_partial_eq(&self, value: &dyn Reflect) -> Option<bool>
fn reflect_partial_eq(&self, value: &dyn Reflect) -> Option<bool>
§fn reflect_hash(&self) -> Option<u64>
fn reflect_hash(&self) -> Option<u64>
§fn debug(&self, f: &mut Formatter<'_>) -> Result<(), Error>
fn debug(&self, f: &mut Formatter<'_>) -> Result<(), Error>
§fn serializable(&self) -> Option<Serializable<'_>>
fn serializable(&self) -> Option<Serializable<'_>>
§fn is_dynamic(&self) -> bool
fn is_dynamic(&self) -> bool
source§impl Serialize for VirtualDPad
impl Serialize for VirtualDPad
source§impl Struct for VirtualDPad
impl Struct for VirtualDPad
source§fn field(&self, name: &str) -> Option<&dyn Reflect>
fn field(&self, name: &str) -> Option<&dyn Reflect>
name as a &dyn Reflect.source§fn field_mut(&mut self, name: &str) -> Option<&mut dyn Reflect>
fn field_mut(&mut self, name: &str) -> Option<&mut dyn Reflect>
name as a
&mut dyn Reflect.source§fn field_at(&self, index: usize) -> Option<&dyn Reflect>
fn field_at(&self, index: usize) -> Option<&dyn Reflect>
index as a
&dyn Reflect.source§fn field_at_mut(&mut self, index: usize) -> Option<&mut dyn Reflect>
fn field_at_mut(&mut self, index: usize) -> Option<&mut dyn Reflect>
index
as a &mut dyn Reflect.source§fn name_at(&self, index: usize) -> Option<&str>
fn name_at(&self, index: usize) -> Option<&str>
index.source§fn iter_fields(&self) -> FieldIter<'_>
fn iter_fields(&self) -> FieldIter<'_>
source§fn clone_dynamic(&self) -> DynamicStruct
fn clone_dynamic(&self) -> DynamicStruct
DynamicStruct].source§impl TypePath for VirtualDPad
impl TypePath for VirtualDPad
source§fn type_path() -> &'static str
fn type_path() -> &'static str
source§fn short_type_path() -> &'static str
fn short_type_path() -> &'static str
source§fn type_ident() -> Option<&'static str>
fn type_ident() -> Option<&'static str>
source§fn crate_name() -> Option<&'static str>
fn crate_name() -> Option<&'static str>
source§impl Typed for VirtualDPad
impl Typed for VirtualDPad
impl Eq for VirtualDPad
impl StructuralPartialEq for VirtualDPad
Auto Trait Implementations§
impl RefUnwindSafe for VirtualDPad
impl Send for VirtualDPad
impl Sync for VirtualDPad
impl Unpin for VirtualDPad
impl UnwindSafe for VirtualDPad
Blanket Implementations§
§impl<T, U> AsBindGroupShaderType<U> for T
impl<T, U> AsBindGroupShaderType<U> for T
§fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U
T [ShaderType] for self. When used in [AsBindGroup]
derives, it is safe to assume that all images in self exist.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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn 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.§fn 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.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> DynEq for T
impl<T> DynEq for T
§impl<T> DynamicTypePath for Twhere
T: TypePath,
impl<T> DynamicTypePath for Twhere
T: TypePath,
§fn reflect_type_path(&self) -> &str
fn reflect_type_path(&self) -> &str
TypePath::type_path].§fn reflect_short_type_path(&self) -> &str
fn reflect_short_type_path(&self) -> &str
TypePath::short_type_path].§fn reflect_type_ident(&self) -> Option<&str>
fn reflect_type_ident(&self) -> Option<&str>
TypePath::type_ident].§fn reflect_crate_name(&self) -> Option<&str>
fn reflect_crate_name(&self) -> Option<&str>
TypePath::crate_name].§fn reflect_module_path(&self) -> Option<&str>
fn reflect_module_path(&self) -> Option<&str>
TypePath::module_path].§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<S> GetField for Swhere
S: Struct,
impl<S> GetField for Swhere
S: Struct,
§impl<T> GetPath for Twhere
T: Reflect + ?Sized,
impl<T> GetPath for Twhere
T: Reflect + ?Sized,
§fn reflect_path<'p>(
&self,
path: impl ReflectPath<'p>
) -> Result<&(dyn Reflect + 'static), ReflectPathError<'p>>
fn reflect_path<'p>( &self, path: impl ReflectPath<'p> ) -> Result<&(dyn Reflect + 'static), ReflectPathError<'p>>
path. Read more§fn reflect_path_mut<'p>(
&mut self,
path: impl ReflectPath<'p>
) -> Result<&mut (dyn Reflect + 'static), ReflectPathError<'p>>
fn reflect_path_mut<'p>( &mut self, path: impl ReflectPath<'p> ) -> Result<&mut (dyn Reflect + 'static), ReflectPathError<'p>>
path. Read more