Class Gamepad
java.lang.Object
dev.prozilla.pine.core.state.input.gamepad.Gamepad
- All Implemented Interfaces:
Destructible
,GamepadInput
Handles input for gamepad devices by reading from
GLFWGamepadState
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
destroy()
Destroys this object.float
getAxis
(int axis) Gets the current value of an axis.boolean
getButton
(int button) Checks whether a button is being pressed.boolean
getButtonDown
(int button) void
input()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface dev.prozilla.pine.core.state.input.gamepad.GamepadInput
getAxis, getButton, getButtonDown
-
Constructor Details
-
Gamepad
public Gamepad(int id)
-
-
Method Details
-
input
public void input() -
destroy
public void destroy()Description copied from interface:Destructible
Destroys this object.- Specified by:
destroy
in interfaceDestructible
-
getAxis
public float getAxis(int axis) Description copied from interface:GamepadInput
Gets the current value of an axis.- Specified by:
getAxis
in interfaceGamepadInput
- Parameters:
axis
- GLFW integer value for a gamepad axis- Returns:
- Value of the axis
-
getButton
public boolean getButton(int button) Description copied from interface:GamepadInput
Checks whether a button is being pressed.- Specified by:
getButton
in interfaceGamepadInput
- Parameters:
button
- GLFW integer value for a gamepad button- Returns:
true
if the button is being pressed
-
getButtonDown
public boolean getButtonDown(int button) - Specified by:
getButtonDown
in interfaceGamepadInput
-