com.jme.input.controls.binding
Class MouseOffsetBinding

java.lang.Object
  extended by com.jme.input.controls.binding.MouseOffsetBinding
All Implemented Interfaces:
Binding, java.io.Serializable

public class MouseOffsetBinding
extends java.lang.Object
implements Binding

The offset mouse binding returns the offset of the mouse cursor from the center of the screen on the given axis. The values returned are in percent: 0 means the MouseCursor is in the Center of the screen, 1 means 100% the MouseCursor touches the screens edge.

Author:
Christoph Luder
See Also:
Serialized Form

Constructor Summary
MouseOffsetBinding(int axis, boolean reverse)
           
 
Method Summary
 java.lang.String getName()
           
 float getValue()
          Returns the offset in percent from the center of the screen on a given Axis.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MouseOffsetBinding

public MouseOffsetBinding(int axis,
                          boolean reverse)
Parameters:
axis - MouseAxisBinding.AXIS_X or AXIS_Y
reverse - true means only track the right/lower part of the screen
Method Detail

getValue

public float getValue()
Returns the offset in percent from the center of the screen on a given Axis.

Specified by:
getValue in interface Binding
Returns:
offset of the mouse pointer in % on the given axis. 0 means the cursor is in the middle. 1 means 100% the mouse cursor is touching the screens edge.

getName

public java.lang.String getName()
Specified by:
getName in interface Binding

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object