public class CustomCursor
extends java.lang.Object
implements com.badlogic.gdx.InputProcessor
InputProcessor
that sets a custom mouse cursor image based on the mouse state.Constructor and Description |
---|
CustomCursor(com.badlogic.gdx.graphics.Pixmap upPixmap,
com.badlogic.gdx.graphics.Pixmap downPixmap,
int xHotspot,
int yHotspot)
Constructor
|
Modifier and Type | Method and Description |
---|---|
boolean |
keyDown(int keycode) |
boolean |
keyTyped(char character) |
boolean |
keyUp(int keycode) |
boolean |
mouseMoved(int screenX,
int screenY) |
boolean |
scrolled(int amount) |
boolean |
touchDown(int screenX,
int screenY,
int pointer,
int button) |
boolean |
touchDragged(int screenX,
int screenY,
int pointer) |
boolean |
touchUp(int screenX,
int screenY,
int pointer,
int button) |
public CustomCursor(com.badlogic.gdx.graphics.Pixmap upPixmap, com.badlogic.gdx.graphics.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)public boolean keyDown(int keycode)
keyDown
in interface com.badlogic.gdx.InputProcessor
public boolean keyUp(int keycode)
keyUp
in interface com.badlogic.gdx.InputProcessor
public boolean keyTyped(char character)
keyTyped
in interface com.badlogic.gdx.InputProcessor
public boolean touchDown(int screenX, int screenY, int pointer, int button)
touchDown
in interface com.badlogic.gdx.InputProcessor
public boolean touchUp(int screenX, int screenY, int pointer, int button)
touchUp
in interface com.badlogic.gdx.InputProcessor
public boolean touchDragged(int screenX, int screenY, int pointer)
touchDragged
in interface com.badlogic.gdx.InputProcessor
public boolean mouseMoved(int screenX, int screenY)
mouseMoved
in interface com.badlogic.gdx.InputProcessor
public boolean scrolled(int amount)
scrolled
in interface com.badlogic.gdx.InputProcessor