public abstract class CustomCursor
extends java.lang.Object
implements org.mini2Dx.gdx.InputProcessor
InputProcessor
that sets a custom mouse cursor image based on the mouse state.Modifier and Type | Field and Description |
---|---|
protected Pixmap |
downPixmap |
protected Pixmap |
emptyPixmap |
protected Pixmap |
upPixmap |
protected boolean |
visible |
protected int |
xHotspot |
protected int |
yHotspot |
Constructor and Description |
---|
CustomCursor(Pixmap upPixmap,
Pixmap downPixmap,
int xHotspot,
int yHotspot)
Constructor
|
Modifier and Type | Method and Description |
---|---|
Pixmap |
getDownPixmap() |
Pixmap |
getEmptyPixmap() |
Pixmap |
getUpPixmap() |
int |
getxHotspot() |
int |
getyHotspot() |
boolean |
isVisible() |
void |
setVisible(boolean visible) |
protected abstract void |
updateCursorVisibility() |
protected final Pixmap upPixmap
protected final Pixmap downPixmap
protected final Pixmap emptyPixmap
protected final int xHotspot
protected final int yHotspot
protected boolean visible
public CustomCursor(Pixmap upPixmap, Pixmap downPixmap, int xHotspot, int yHotspot)
upPixmap
- The image to use in the mouse button up statedownPixmap
- The image to use in the mouse button down statexHotspot
- The x location of the hotspot pixel within the cursor image (origin top-left corner)yHotspot
- The y location of the hotspot pixel within the cursor image (origin top-left corner)protected abstract void updateCursorVisibility()
public Pixmap getUpPixmap()
public Pixmap getDownPixmap()
public Pixmap getEmptyPixmap()
public int getxHotspot()
public int getyHotspot()
public boolean isVisible()
public void setVisible(boolean visible)