public class XboxUiInput extends XboxGamePadAdapter implements GamePadUiInput<XboxButton>
XboxGamePad implementation of GamePadUiInput| Constructor and Description |
|---|
XboxUiInput(UiContainer uiContainer) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
buttonDown(XboxGamePad controller,
XboxButton button)
Called when a button is pressed down
|
boolean |
buttonUp(XboxGamePad controller,
XboxButton button)
Called when a button is released
|
void |
disable()
Disables this gamepad input for the
UiContainer |
void |
dispose()
Cleans up and de-registers this instance from the associated
UiContainer |
void |
enable()
Enables this gamepad input for the
UiContainer |
boolean |
equals(java.lang.Object obj) |
XboxButton |
getActionButton()
Returns the button used to trigger
Actionable instances |
java.lang.String |
getId()
Returns the unique id of this
GamePadUiInput |
int |
hashCode() |
boolean |
isEnabled()
Returns if the gamepad input is enabled for the
UiContainer |
boolean |
isNavigateWithDPad()
Returns if
UiNavigation events should be triggered by the D-PAD |
boolean |
leftStickXMoved(XboxGamePad controller,
float value)
Called when left stick moves along its X axis
|
boolean |
leftStickYMoved(XboxGamePad controller,
float value)
Called when left stick moves along its Y axis
|
void |
setActionButton(XboxButton actionButton)
Sets the button used for triggering
Actionable instances |
void |
setDebug(boolean debug) |
void |
setNavigateWithDPad(boolean navigateWithDPad)
Sets if
UiNavigation events should be triggered by the D-PAD |
void |
setStickRepeatTimer(float stickRepeatTimer)
Sets the amount of time in seconds before the left stick is considered repeating a navigation direction
|
void |
setStickThreshold(float stickThreshold)
Sets the threshold for stick values before the input is considered as a navigation direction press
|
void |
update(float delta)
Updates the input for repeating presses
|
connected, disconnected, leftTriggerMoved, rightStickXMoved, rightStickYMoved, rightTriggerMovedpublic XboxUiInput(UiContainer uiContainer)
public void update(float delta)
GamePadUiInputupdate in interface GamePadUiInput<XboxButton>delta - The time since the last frame (in seconds)public boolean leftStickXMoved(XboxGamePad controller, float value)
XboxGamePadListenerleftStickXMoved in interface XboxGamePadListenerleftStickXMoved in class XboxGamePadAdaptercontroller - The gamepad that this event came fromvalue - ~-1f at left, ~0f at center, ~1f at right (values may never be
accurate due to dead zones, apply a DeadZone to the
gamepad instance to correct this)public boolean leftStickYMoved(XboxGamePad controller, float value)
XboxGamePadListenerleftStickYMoved in interface XboxGamePadListenerleftStickYMoved in class XboxGamePadAdaptercontroller - The gamepad that this event came fromvalue - ~-1f at top, ~0f at center, ~1f at bottom (values may never be
accurate due to dead zones, apply a DeadZone to the
gamepad instance to correct this)public boolean buttonDown(XboxGamePad controller, XboxButton button)
XboxGamePadListenerbuttonDown in interface XboxGamePadListenerbuttonDown in class XboxGamePadAdaptercontroller - The gamePad that this event came frombutton - The button that was pressedpublic boolean buttonUp(XboxGamePad controller, XboxButton button)
XboxGamePadListenerbuttonUp in interface XboxGamePadListenerbuttonUp in class XboxGamePadAdaptercontroller - The gamepad that this event came frombutton - The button that was releasedpublic boolean isEnabled()
GamePadUiInputUiContainerisEnabled in interface GamePadUiInput<XboxButton>public void enable()
GamePadUiInputUiContainerenable in interface GamePadUiInput<XboxButton>public void disable()
GamePadUiInputUiContainerdisable in interface GamePadUiInput<XboxButton>public void setStickRepeatTimer(float stickRepeatTimer)
stickRepeatTimer - Default value is 0.25 secondspublic void setStickThreshold(float stickThreshold)
stickThreshold - Default value is 0.25public boolean isNavigateWithDPad()
UiNavigation events should be triggered by the D-PADpublic void setNavigateWithDPad(boolean navigateWithDPad)
UiNavigation events should be triggered by the D-PADnavigateWithDPad - True if events should be triggeredpublic void setDebug(boolean debug)
public XboxButton getActionButton()
GamePadUiInputActionable instancesgetActionButton in interface GamePadUiInput<XboxButton>public void setActionButton(XboxButton actionButton)
GamePadUiInputActionable instancessetActionButton in interface GamePadUiInput<XboxButton>public void dispose()
GamePadUiInputUiContainerdispose in interface GamePadUiInput<XboxButton>public java.lang.String getId()
GamePadUiInputGamePadUiInputgetId in interface GamePadUiInput<XboxButton>Stringpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Object