Package de.gurkenlabs.litiengine.input
Class GamepadEvent
java.lang.Object
java.util.EventObject
de.gurkenlabs.litiengine.input.GamepadEvent
- All Implemented Interfaces:
Serializable
- See Also:
-
Field Summary
Fields inherited from class java.util.EventObject
source -
Method Summary
Modifier and TypeMethodDescriptionGets the identifier of the component that caused this event.Gets the name of the component that caused this event.Gets the gamepad that caused the event.floatgetValue()Gets the data from the last time the component has been polled.booleanisAnalog()Returns whether or not the axis is analog, or false if it is digital.booleanReturnstrueif data returned frompollis relative to the last call, orfalseif data is absolute.Methods inherited from class java.util.EventObject
getSource, toString
-
Method Details
-
getValue
public float getValue()Gets the data from the last time the component has been polled. If this axis is a button, the value returned will be either 0.0f or 1.0f. If this axis is normalized, the value returned will be between -1.0f and 1.0f.- Returns:
- The last poll value of the component of this event.
-
getComponentId
Gets the identifier of the component that caused this event.- Returns:
- The identifier of the component.
-
getComponentName
Gets the name of the component that caused this event.- Returns:
- The human-readable name of the component.
-
getGamepad
Gets the gamepad that caused the event.- Returns:
- The gamepad of this event.
-
isRelative
public boolean isRelative()Returnstrueif data returned frompollis relative to the last call, orfalseif data is absolute.- Returns:
- True if the data is relative; otherwise false.
-
isAnalog
public boolean isAnalog()Returns whether or not the axis is analog, or false if it is digital.- Returns:
- True if the component is analog; otherwise false.
-