diff --git a/src/game/RhythmState.java b/src/game/RhythmState.java index 8e32409..bc923ef 100644 --- a/src/game/RhythmState.java +++ b/src/game/RhythmState.java @@ -63,6 +63,8 @@ public class RhythmState extends DefaultGameState { private int beatmapindex = 0; private Input inp; // Get various information about input (e.g. mouse position) + private Image cursor; + private Vector2f cursorcenter; private GameContainer gamecontainer; @@ -74,7 +76,9 @@ public RhythmState(int id) { public void enter(GameContainer gc, StateBasedGame arg1) throws SlickException { gamecontainer = gc; inp = gc.getInput(); - gc.setMouseCursor("res/cursor.png", 80, 80); + gc.setMouseGrabbed(true); + cursor = new Image("res/cursor.png"); + cursorcenter = new Vector2f(cursor.getWidth() / 2, cursor.getHeight() / 2); String beatmapzipfilename = "725875 Sanshuu Chuugaku Yuushabu - Hoshi to Hana.osz"; String beatmaporigin = "res/sample_osu_beatmaps/"; @@ -185,6 +189,9 @@ public void render(GameContainer gc, StateBasedGame arg1, Graphics g) 10, 90); g.drawString("Perfection: " + perfectionpercent + "%", 10, 110); + + g.drawImage(cursor, inp.getMouseX() - cursorcenter.x, + inp.getMouseY() - cursorcenter.y); } @Override