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 TypeMethodDescriptionvoiddestroy()Destroys this object.floatgetAxis(int axis) Gets the current value of an axis.booleangetButton(int button) Checks whether a button is being pressed.booleangetButtonDown(int button) voidinput()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:DestructibleDestroys this object.- Specified by:
destroyin interfaceDestructible
-
getAxis
public float getAxis(int axis) Description copied from interface:GamepadInputGets the current value of an axis.- Specified by:
getAxisin 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:GamepadInputChecks whether a button is being pressed.- Specified by:
getButtonin interfaceGamepadInput- Parameters:
button- GLFW integer value for a gamepad button- Returns:
trueif the button is being pressed
-
getButtonDown
public boolean getButtonDown(int button) - Specified by:
getButtonDownin interfaceGamepadInput
-