com.jme.input.util
Class TwoButtonAxis
java.lang.Object
com.jme.input.util.SyntheticTriggerContainer
com.jme.input.util.SyntheticAxis
com.jme.input.util.TwoButtonAxis
public class TwoButtonAxis
- extends SyntheticAxis
This is a utility class to simulate an axis from two buttons (or keys). For a usage example see TestInputHandler.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TwoButtonAxis
public TwoButtonAxis(java.lang.String name)
- Parameters:
name
- the name of this new axis
getValue
public float getValue()
- Returns:
- current value/position of this axis
isDiscreet
public boolean isDiscreet()
- Returns:
- true if a single keystoke changes the axis value by the action speed, false if continuous
(multiplied with frame time)
setDiscreet
public void setDiscreet(boolean discreet)
- Parameters:
discreet
- true if a single keystoke should change the axis value by the action speed, false if continuous
(multiplied with frame time)
getDecreaseAction
public InputAction getDecreaseAction()
- The returned action should be subscribed with an InputHandler to be invoked any time the axis should decrease.
When
isDiscreet()
is true it is commonly registed with allowRepeats==false, while allowRepeats should be
true when isDiscreet()
is false.
- Returns:
- the action that decreases the axis value
getIncreaseAction
public InputAction getIncreaseAction()
- The returned action should be subscribed with an InputHandler to be invoked any time the axis should increase.
When
isDiscreet()
is true it is commonly registed with allowRepeats==false, while allowRepeats should be
true when isDiscreet()
is false.
- Returns:
- the action that increases the axis value