com.b3dgs.lionengine.drawable
Interface Cursor

All Known Implementing Classes:
StrategyCursor

public interface Cursor

Used to represent a mouse cursor, desynchronized from the window mouse pointer. This way, it is possible to set a specific sensibility.

See Also:
Mouse

Method Summary
 void fixBetween(int minX, int minY, int maxX, int maxY)
          Allow cursor to move only in the specified area.
 int getClick()
          Return mouse click number.
 float getHorizontalSensibility()
          Get horizontal sensibility.
 float getVerticalSensibility()
          Get vertical sensibility.
 int getX()
          Get horizontal location.
 int getY()
          Get vertical location.
 void lockMouse(boolean lock)
          Lock mouse state.
 void place(int x, int y)
          Set cursor location.
 void render(java.awt.Graphics2D g)
          Render cursor on screen.
 void setSensibility(int sh, int sv)
          Set cursor sensibility (move speed).
 void update(Mouse mouse, boolean async, float extrp)
          Update cursor position depending of mouse movement.
 

Method Detail

update

void update(Mouse mouse,
            boolean async,
            float extrp)
Update cursor position depending of mouse movement.

Parameters:
mouse - mouse reference.
extrp - extrapolation value.

render

void render(java.awt.Graphics2D g)
Render cursor on screen.

Parameters:
g - graphic output.

setSensibility

void setSensibility(int sh,
                    int sv)
Set cursor sensibility (move speed).

Parameters:
sh - horizontal speed.
sv - vertical speed.

fixBetween

void fixBetween(int minX,
                int minY,
                int maxX,
                int maxY)
Allow cursor to move only in the specified area.

Parameters:
minX - minimal x.
minY - minimal y.
maxX - maximal x.
maxY - maximal y.

place

void place(int x,
           int y)
Set cursor location.

Parameters:
x - horizontal location.
y - vertical location.

lockMouse

void lockMouse(boolean lock)
Lock mouse state.

Parameters:
lock - true to lock mouse.

getClick

int getClick()
Return mouse click number.

Returns:
mouse click number.

getX

int getX()
Get horizontal location.

Returns:
horizontal location.

getY

int getY()
Get vertical location.

Returns:
vertical location.

getHorizontalSensibility

float getHorizontalSensibility()
Get horizontal sensibility.

Returns:
horizontal sensibility.

getVerticalSensibility

float getVerticalSensibility()
Get vertical sensibility.

Returns:
vertical sensibility.