I have this code:
@Override
public boolean mouseMoved(int screenX, int screenY) {
float deltaX = Gdx.input.getDeltaX();
camera.rotate(Vector3.Y, deltaX * -0.3f);
Gdx.input.setCursorPosition(Gdx.graphics.getWidth() / 2, -Gdx.graphics.getHeight() / 2);
return true;
}
I need to be able to set the cursor position to the centre of the screen while still being able to move the mouse a little bit and get the delta-x. This is so the mouse doesn’t get stuck at the edge of the screen so, if there’s any other way to do this, that’s useful too!