v1.3.0: implemented new radial menus and made a bunch of keybind changes
This commit is contained in:
@@ -24,7 +24,10 @@ package com.watabou.noosa.ui;
|
||||
import com.badlogic.gdx.Files;
|
||||
import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.graphics.Pixmap;
|
||||
import com.watabou.input.ControllerHandler;
|
||||
import com.watabou.noosa.Game;
|
||||
import com.watabou.utils.FileUtils;
|
||||
import com.watabou.utils.PointF;
|
||||
|
||||
public class Cursor {
|
||||
|
||||
@@ -86,4 +89,30 @@ public class Cursor {
|
||||
|
||||
}
|
||||
|
||||
private static boolean cursorCaptured = false;
|
||||
|
||||
public static void captureCursor(boolean captured){
|
||||
cursorCaptured = captured;
|
||||
|
||||
if (captured) {
|
||||
Gdx.input.setCursorCatched(true);
|
||||
} else {
|
||||
if (ControllerHandler.controllerPointerActive()) {
|
||||
ControllerHandler.setControllerPointer(true);
|
||||
ControllerHandler.updateControllerPointer(new PointF(Game.width/2, Game.height/2), false);
|
||||
} else {
|
||||
Gdx.input.setCursorCatched(false);
|
||||
Gdx.input.setCursorPosition(Game.width/2, Game.height/2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static PointF getCursorDelta(){
|
||||
return new PointF(Gdx.input.getDeltaX(), Gdx.input.getDeltaY());
|
||||
}
|
||||
|
||||
public static boolean isCursorCaptured(){
|
||||
return cursorCaptured;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user