java.lang.Object
dev.prozilla.pine.core.state.input.gamepad.Gamepad
All Implemented Interfaces:
Destructible, GamepadInput

public class Gamepad extends Object implements GamepadInput, Destructible
Handles input for gamepad devices by reading from GLFWGamepadState.
  • 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 interface Destructible
    • getAxis

      public float getAxis(int axis)
      Description copied from interface: GamepadInput
      Gets the current value of an axis.
      Specified by:
      getAxis in interface GamepadInput
      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 interface GamepadInput
      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 interface GamepadInput