Package com.prineside.luaj.mapping.parts
Class LJ_GDX.Controller_AN.LIP
java.lang.Object
com.prineside.luaj.mapping.InterfaceProxy
com.prineside.luaj.mapping.parts.LJ_GDX.Controller_AN.LIP
- All Implemented Interfaces:
com.badlogic.gdx.controllers.Controller
,com.esotericsoftware.kryo.KryoSerializable
- Enclosing class:
- LJ_GDX.Controller_AN
public static class LJ_GDX.Controller_AN.LIP
extends InterfaceProxy
implements com.badlogic.gdx.controllers.Controller
-
Field Summary
Fields inherited from interface com.badlogic.gdx.controllers.Controller
PLAYER_IDX_UNSET
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(com.badlogic.gdx.controllers.ControllerListener p1) Adds a newControllerListener
to thisController
.void
Cancel any running vibration.boolean
float
getAxis
(int p1) int
boolean
getButton
(int p1) com.badlogic.gdx.controllers.ControllerMapping
int
int
getName()
int
com.badlogic.gdx.controllers.ControllerPowerLevel
boolean
boolean
void
removeListener
(com.badlogic.gdx.controllers.ControllerListener p1) Removes the givenControllerListener
void
setPlayerIndex
(int p1) Sets the player index of this controller.void
startVibration
(int p1, float p2) Starts vibrating this controller, if possible.boolean
Methods inherited from class com.prineside.luaj.mapping.InterfaceProxy
getLuaObj, read, write
-
Method Details
-
addListener
public void addListener(com.badlogic.gdx.controllers.ControllerListener p1) Description copied from interface:com.badlogic.gdx.controllers.Controller
Adds a newControllerListener
to thisController
. The listener will receive calls in case the state of the controller changes. The listener will be invoked on the rendering thread.- Specified by:
addListener
in interfacecom.badlogic.gdx.controllers.Controller
-
canVibrate
public boolean canVibrate()- Specified by:
canVibrate
in interfacecom.badlogic.gdx.controllers.Controller
- Returns:
- whether the connected controller or the current controller implementation can rumble. Note that this is no guarantee that the connected controller itself can vibrate.
-
cancelVibration
public void cancelVibration()Description copied from interface:com.badlogic.gdx.controllers.Controller
Cancel any running vibration. May not be supported by implementations- Specified by:
cancelVibration
in interfacecom.badlogic.gdx.controllers.Controller
-
getAxis
public float getAxis(int p1) - Specified by:
getAxis
in interfacecom.badlogic.gdx.controllers.Controller
- Returns:
- the value of the axis, between -1 and 1
-
getAxisCount
public int getAxisCount()- Specified by:
getAxisCount
in interfacecom.badlogic.gdx.controllers.Controller
- Returns:
- number of axis of this controller. Axis indices start at 0, so the maximum axis index is one under this value.
-
getButton
public boolean getButton(int p1) - Specified by:
getButton
in interfacecom.badlogic.gdx.controllers.Controller
- Returns:
- whether the button is pressed.
-
getMapping
public com.badlogic.gdx.controllers.ControllerMapping getMapping()- Specified by:
getMapping
in interfacecom.badlogic.gdx.controllers.Controller
- Returns:
- button and axis mapping for this controller (or platform). The connected controller might not support all features.
-
getMaxButtonIndex
public int getMaxButtonIndex()- Specified by:
getMaxButtonIndex
in interfacecom.badlogic.gdx.controllers.Controller
- Returns:
- the maximum button index code that can be queried
-
getMinButtonIndex
public int getMinButtonIndex()- Specified by:
getMinButtonIndex
in interfacecom.badlogic.gdx.controllers.Controller
- Returns:
- the minimum button index code that can be queried
-
getName
- Specified by:
getName
in interfacecom.badlogic.gdx.controllers.Controller
- Returns:
- the device name
-
getPlayerIndex
public int getPlayerIndex()- Specified by:
getPlayerIndex
in interfacecom.badlogic.gdx.controllers.Controller
- Returns:
- 0-based player index of this controller, or PLAYER_IDX_UNSET if none is set
-
getPowerLevel
public com.badlogic.gdx.controllers.ControllerPowerLevel getPowerLevel()- Specified by:
getPowerLevel
in interfacecom.badlogic.gdx.controllers.Controller
- Returns:
- value of enum
ControllerPowerLevel
indicating battery state of the connected controller, orControllerPowerLevel.POWER_UNKNOWN
if information is not present
-
getUniqueId
- Specified by:
getUniqueId
in interfacecom.badlogic.gdx.controllers.Controller
- Returns:
- unique ID to recognize this controller if more than one of the same controller models are connected. Use this to map a controller to a player, but do not use it to save a button mapping.
-
isConnected
public boolean isConnected()- Specified by:
isConnected
in interfacecom.badlogic.gdx.controllers.Controller
- Returns:
- true when this Controller is still connected, false if it already disconnected
-
isVibrating
public boolean isVibrating()- Specified by:
isVibrating
in interfacecom.badlogic.gdx.controllers.Controller
- Returns:
- if the controller is currently rumbling
-
removeListener
public void removeListener(com.badlogic.gdx.controllers.ControllerListener p1) Description copied from interface:com.badlogic.gdx.controllers.Controller
Removes the givenControllerListener
- Specified by:
removeListener
in interfacecom.badlogic.gdx.controllers.Controller
-
setPlayerIndex
public void setPlayerIndex(int p1) Description copied from interface:com.badlogic.gdx.controllers.Controller
Sets the player index of this controller. Please note that this does not always set indication lights of controllers, it is just an internal representation on some platforms- Specified by:
setPlayerIndex
in interfacecom.badlogic.gdx.controllers.Controller
- Parameters:
p1
- 0 typically 0 to 3 for player indices, and PLAYER_IDX_UNSET for unset
-
startVibration
public void startVibration(int p1, float p2) Description copied from interface:com.badlogic.gdx.controllers.Controller
Starts vibrating this controller, if possible.- Specified by:
startVibration
in interfacecom.badlogic.gdx.controllers.Controller
- Parameters:
p1
- duration, in millisecondsp2
- value between 0f and 1f
-
supportsPlayerIndex
public boolean supportsPlayerIndex()- Specified by:
supportsPlayerIndex
in interfacecom.badlogic.gdx.controllers.Controller
- Returns:
- whether the connected controller (or the implementation) can return and set the current player index
-