pub enum DPad4 {
None,
Left,
Right,
Up,
Down,
}Expand description
4-directional DPad-like representation of the Pad.
Constructed with Pad::as_dpad4. Useful for simple games and ports.
The middle of the pad is a “dead zone” pressing which will not activate any direction.
Implements all the same methods as DPad8.
Variants§
Implementations§
Source§impl DPad4
impl DPad4
Sourcepub fn just_pressed(self, old: Self) -> Self
pub fn just_pressed(self, old: Self) -> Self
Given the old state, get directions that were not pressed but are pressed now.
Sourcepub fn just_released(self, old: Self) -> Self
pub fn just_released(self, old: Self) -> Self
Given the old state, get directions that were pressed but aren’t pressed now.
Trait Implementations§
Source§impl Ord for DPad4
impl Ord for DPad4
Source§impl PartialOrd for DPad4
impl PartialOrd for DPad4
impl Copy for DPad4
impl Eq for DPad4
impl StructuralPartialEq for DPad4
Auto Trait Implementations§
impl Freeze for DPad4
impl RefUnwindSafe for DPad4
impl Send for DPad4
impl Sync for DPad4
impl Unpin for DPad4
impl UnwindSafe for DPad4
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