public class Xbox360UiInput extends Xbox360ControllerAdapter implements ControllerUiInput<Xbox360Button>
Xbox360Controller implementation of ControllerUiInput| Constructor and Description |
|---|
Xbox360UiInput(UiContainer uiContainer) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
buttonDown(Xbox360Controller controller,
Xbox360Button button)
Called when a button is pressed down
|
boolean |
buttonUp(Xbox360Controller controller,
Xbox360Button button)
Called when a button is released
|
void |
disable()
Disables this controller input for the
UiContainer |
void |
dispose()
Cleans up and de-registers this instance from the associated
UiContainer |
void |
enable()
Enables this controller input for the
UiContainer |
boolean |
equals(java.lang.Object obj) |
Xbox360Button |
getActionButton()
Returns the button used to trigger
Actionable instances |
java.lang.String |
getId()
Returns the unique id of this
ControllerUiInput |
int |
hashCode() |
boolean |
isEnabled()
Returns if the controller input is enabled for the
UiContainer |
boolean |
leftStickXMoved(Xbox360Controller controller,
float value)
Called when left stick moves along its X axis
|
boolean |
leftStickYMoved(Xbox360Controller controller,
float value)
Called when left stick moves along its Y axis
|
void |
setActionButton(Xbox360Button actionButton)
Sets the button used for triggering
Actionable instances |
void |
setDebug(boolean debug) |
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
|
disconnected, leftTriggerMoved, rightStickXMoved, rightStickYMoved, rightTriggerMovedpublic Xbox360UiInput(UiContainer uiContainer)
public void update(float delta)
ControllerUiInputupdate in interface ControllerUiInput<Xbox360Button>delta - The time since the last frame (in seconds)public boolean leftStickXMoved(Xbox360Controller controller, float value)
Xbox360ControllerListenerleftStickXMoved in interface Xbox360ControllerListenerleftStickXMoved in class Xbox360ControllerAdaptercontroller - The controller 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
controller instance to correct this)public boolean leftStickYMoved(Xbox360Controller controller, float value)
Xbox360ControllerListenerleftStickYMoved in interface Xbox360ControllerListenerleftStickYMoved in class Xbox360ControllerAdaptercontroller - The controller 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
controller instance to correct this)public boolean buttonDown(Xbox360Controller controller, Xbox360Button button)
Xbox360ControllerListenerbuttonDown in interface Xbox360ControllerListenerbuttonDown in class Xbox360ControllerAdaptercontroller - The controller that this event came frombutton - The button that was pressedpublic boolean buttonUp(Xbox360Controller controller, Xbox360Button button)
Xbox360ControllerListenerbuttonUp in interface Xbox360ControllerListenerbuttonUp in class Xbox360ControllerAdaptercontroller - The controller that this event came frombutton - The button that was releasedpublic boolean isEnabled()
ControllerUiInputUiContainerisEnabled in interface ControllerUiInput<Xbox360Button>public void enable()
ControllerUiInputUiContainerenable in interface ControllerUiInput<Xbox360Button>public void disable()
ControllerUiInputUiContainerdisable in interface ControllerUiInput<Xbox360Button>public void setStickRepeatTimer(float stickRepeatTimer)
stickRepeatTimer - Default value is 0.25 secondspublic void setStickThreshold(float stickThreshold)
stickThreshold - Default value is 0.25public void setDebug(boolean debug)
public Xbox360Button getActionButton()
ControllerUiInputActionable instancesgetActionButton in interface ControllerUiInput<Xbox360Button>public void setActionButton(Xbox360Button actionButton)
ControllerUiInputActionable instancessetActionButton in interface ControllerUiInput<Xbox360Button>public void dispose()
ControllerUiInputUiContainerdispose in interface ControllerUiInput<Xbox360Button>public java.lang.String getId()
ControllerUiInputControllerUiInputgetId in interface ControllerUiInput<Xbox360Button>Stringpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Object