public class LibgdxAdvancedGamePad extends LibgdxGamePad
Modifier and Type | Field and Description |
---|---|
com.badlogic.gdx.controllers.AdvancedController |
advancedController |
protected float |
vibrateStrength |
connected, gamePadType
Constructor and Description |
---|
LibgdxAdvancedGamePad(com.badlogic.gdx.controllers.AdvancedController controller) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getInstanceId()
Returns the ID for this
GamePad . |
int |
getPlayerIndex()
Returns the player assigned to this gamepad
|
float |
getVibrationStrength()
Returns the strength of the vibration/rumble
|
boolean |
isPlayerIndicesSupported()
Returns if this game pad supports assigning player numbers to it
|
boolean |
isVibrateSupported()
Returns if this gamepad has vibrate/rumble functionality
|
boolean |
isVibrating()
Returns if this gamepad is currently vibrating/rumbling
|
void |
setPlayerIndex(int playerIndex)
Sets the player assigned to this gamepad
|
void |
startVibration(float strength)
Starts vibrating/rumbling the gamepad
|
void |
stopVibration()
Stops the vibrating/rumbling of the gamepad
|
accelerometerMoved, addListener, axisMoved, buttonDown, buttonUp, connected, disconnected, getAccelerometer, getAccelerometerSensitivity, getAxis, getGamePadType, getModelInfo, getPov, init, isAccelerometerSupported, isButtonDown, isButtonUp, isConnected, notifyAccelerometerChanged, notifyAxisChanged, notifyButtonDown, notifyButtonUp, notifyConnected, notifyDisconnected, notifyPovChanged, povMoved, removeListener, setAccelerometerSensitivity, xSliderMoved, ySliderMoved
public final com.badlogic.gdx.controllers.AdvancedController advancedController
protected float vibrateStrength
public LibgdxAdvancedGamePad(com.badlogic.gdx.controllers.AdvancedController controller)
public java.lang.String getInstanceId()
GamePad
GamePad
.
When supported by the driver, if multiple gamepads are connected each will have a unique instance id.
Otherwise, this will fallback for to the name of the device returned by the driver.
If a gamepad is unplugged and reconnected, it will have the same ID.getInstanceId
in interface GamePad
getInstanceId
in class LibgdxGamePad
public boolean isPlayerIndicesSupported()
GamePad
isPlayerIndicesSupported
in interface GamePad
isPlayerIndicesSupported
in class LibgdxGamePad
public int getPlayerIndex()
GamePad
getPlayerIndex
in interface GamePad
getPlayerIndex
in class LibgdxGamePad
public void setPlayerIndex(int playerIndex)
GamePad
setPlayerIndex
in interface GamePad
setPlayerIndex
in class LibgdxGamePad
playerIndex
- -1 if unassignedpublic boolean isVibrateSupported()
GamePad
isVibrateSupported
in interface GamePad
isVibrateSupported
in class LibgdxGamePad
public boolean isVibrating()
GamePad
isVibrating
in interface GamePad
isVibrating
in class LibgdxGamePad
public float getVibrationStrength()
GamePad
getVibrationStrength
in interface GamePad
getVibrationStrength
in class LibgdxGamePad
public void startVibration(float strength)
GamePad
startVibration
in interface GamePad
startVibration
in class LibgdxGamePad
strength
- A value between 0f and 1fpublic void stopVibration()
GamePad
stopVibration
in interface GamePad
stopVibration
in class LibgdxGamePad