[][src]Enum ggez::event::Axis

#[repr(u16)]pub enum Axis {
    LeftStickX,
    LeftStickY,
    LeftZ,
    RightStickX,
    RightStickY,
    RightZ,
    DPadX,
    DPadY,
    Unknown,
}

An analog axis of some device (gamepad thumbstick, joystick...). Gamepad's elements which state can be represented by value from -1.0 to 1.0.

Controller layout

Variants

LeftStickX
LeftStickY
LeftZ
RightStickX
RightStickY
RightZ
DPadX
DPadY
Unknown

Implementations

impl Axis[src]

An analog axis of some device (gamepad thumbstick, joystick...).

pub fn is_stick(self) -> bool[src]

Returns true if axis is LeftStickX, LeftStickY, RightStickX or RightStickY.

pub fn second_axis(self) -> Option<Axis>[src]

Returns the other axis from same element of gamepad, if any.

inputoutput
LeftStickXSome(LeftStickY)
LeftStickYSome(LeftStickX)
RightStickXSome(RightStickY)
RightStickYSome(RightStickX)
DpadXSome(DpadY)
DpadYSome(DpadX)
None

Trait Implementations

impl Clone for Axis[src]

impl Copy for Axis[src]

impl Debug for Axis[src]

impl Eq for Axis[src]

impl Hash for Axis[src]

impl PartialEq<Axis> for Axis[src]

impl StructuralEq for Axis[src]

impl StructuralPartialEq for Axis[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,