com.b3dgs.lionengine.input
Interface Mouse


public interface Mouse

Represents the mouse input. Gives informations such as mouse click and cursor location.


Field Summary
static int LEFT
          Left click.
static int MIDDLE
          Middle click.
static int RIGHT
          Right click.
 
Method Summary
 void doClick(int click)
          Perform a click.
 void doClickAt(int click, int x, int y)
          Perform a click at specified coordinate.
 int getMouseClick()
          Get current pressed click.
 int getMoveX()
          Get mouse horizontal move.
 int getMoveY()
          Get mouse vertical move.
 int getOnScreenX()
          Get location on screen x.
 int getOnScreenY()
          Get location on screen y.
 int getOnWindowX()
          Get location on window x.
 int getOnWindowY()
          Get location on window y.
 boolean hasClicked(int click)
          Check if click if pressed.
 boolean hasClickedOnce(int click)
          Check if click if pressed once only (ignore 'still clicked').
 void lock()
          Lock mouse at its center.
 void lock(int x, int y)
          Lock mouse at specified location.
 void setCenter(int x, int y)
          Set mouse center for lock operation.
 void update()
          Update mouse.
 

Field Detail

LEFT

static final int LEFT
Left click.

See Also:
Constant Field Values

MIDDLE

static final int MIDDLE
Middle click.

See Also:
Constant Field Values

RIGHT

static final int RIGHT
Right click.

See Also:
Constant Field Values
Method Detail

hasClicked

boolean hasClicked(int click)
Check if click if pressed.

Parameters:
click - click to check.
Returns:
pressed state.

hasClickedOnce

boolean hasClickedOnce(int click)
Check if click if pressed once only (ignore 'still clicked').

Parameters:
click - click to check.
Returns:
pressed state.

getMouseClick

int getMouseClick()
Get current pressed click.

Returns:
pressed click.

getOnScreenX

int getOnScreenX()
Get location on screen x.

Returns:
location on screen x.

getOnScreenY

int getOnScreenY()
Get location on screen y.

Returns:
location on screen y.

getOnWindowX

int getOnWindowX()
Get location on window x.

Returns:
location on window x.

getOnWindowY

int getOnWindowY()
Get location on window y.

Returns:
location on window y.

getMoveX

int getMoveX()
Get mouse horizontal move.

Returns:
horizontal move.

getMoveY

int getMoveY()
Get mouse vertical move.

Returns:
vertical move.

setCenter

void setCenter(int x,
               int y)
Set mouse center for lock operation.

Parameters:
x - location x.
y - location y.

lock

void lock()
Lock mouse at its center.


lock

void lock(int x,
          int y)
Lock mouse at specified location.

Parameters:
x - location x.
y - location y.

update

void update()
Update mouse.


doClick

void doClick(int click)
Perform a click.

Parameters:
click - click to perform.

doClickAt

void doClickAt(int click,
               int x,
               int y)
Perform a click at specified coordinate.

Parameters:
click - click to perform.
x - location x.
y - location y.