feud.testgame.util
Class MouseMapper

java.lang.Object
  extended byfeud.testgame.util.MouseMapper

public class MouseMapper
extends java.lang.Object

A helper class similar to the KeyMapper-class from the jPCT-API that simplyfies mouse handling.


Constructor Summary
MouseMapper(com.threed.jpct.FrameBuffer buffer)
          Create a new mapper.
 
Method Summary
 boolean buttonDown(int button)
          If a mouse button down?
 void destroy()
          Destroy the mapper and the mouse (virtually...:-))
 int getDeltaX()
          Gets the delta in x-direction since the last call.
 int getDeltaY()
          Gets the delta in y-direction since the last call.
 int getMouseX()
          Gets the x-coordinate of the mouse.
 int getMouseY()
          Gets the y-coordinate of the mouse.
 void hide()
          Hide the mouse.
 boolean isVisible()
          Is the mouse visible (i.e. not hidden)?
 void show()
          Show the mouse.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MouseMapper

public MouseMapper(com.threed.jpct.FrameBuffer buffer)
Create a new mapper.

Parameters:
buffer - the current frame buffer
Method Detail

hide

public void hide()
Hide the mouse.


show

public void show()
Show the mouse.


isVisible

public boolean isVisible()
Is the mouse visible (i.e. not hidden)?

Returns:
boolean is it?

destroy

public void destroy()
Destroy the mapper and the mouse (virtually...:-))


buttonDown

public boolean buttonDown(int button)
If a mouse button down?

Parameters:
button - the button's number
Returns:
boolean is it down?

getMouseX

public int getMouseX()
Gets the x-coordinate of the mouse.

Returns:
the x-coordinate

getMouseY

public int getMouseY()
Gets the y-coordinate of the mouse.

Returns:
the y-coordinate

getDeltaX

public int getDeltaX()
Gets the delta in x-direction since the last call.

Returns:
int the delta

getDeltaY

public int getDeltaY()
Gets the delta in y-direction since the last call.

Returns:
int the delta