本文整理了Java中com.badlogic.gdx.Input.setCursorCatched()
方法的一些代码示例,展示了Input.setCursorCatched()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Input.setCursorCatched()
方法的具体详情如下:
包路径:com.badlogic.gdx.Input
类名称:Input
方法名:setCursorCatched
[英]Only viable on the desktop. Will confine the mouse cursor location to the window and hide the mouse cursor. X and y coordinates are still reported as if the mouse was not catched.
[中]只有在桌面上才可行。将鼠标光标位置限制在窗口中并隐藏鼠标光标。X和y坐标仍然报告为未捕获鼠标。
代码示例来源:origin: libgdx/libgdx
@Override
public void setCursorCatched (boolean catched) {
input.setCursorCatched(catched);
}
代码示例来源:origin: libgdx/libgdx
@Override
public boolean keyDown (int keycode) {
Gdx.app.log("Input Test", "key down: " + keycode);
if (keycode == Keys.G) Gdx.input.setCursorCatched(!Gdx.input.isCursorCatched());
return false;
}
代码示例来源:origin: libgdx/libgdx
@Override
public void run () {
graphics.setVSync(graphics.config.vSyncEnabled);
try {
LwjglApplication.this.mainLoop();
} catch (Throwable t) {
if (audio != null) audio.dispose();
Gdx.input.setCursorCatched(false);
if (t instanceof RuntimeException)
throw (RuntimeException)t;
else
throw new GdxRuntimeException(t);
}
}
};
代码示例来源:origin: libgdx/libgdx
@Override
public void run () {
graphics.setVSync(graphics.config.vSyncEnabled);
try {
LwjglApplication.this.mainLoop();
} catch (Throwable t) {
if (audio != null) audio.dispose();
Gdx.input.setCursorCatched(false);
if (t instanceof RuntimeException)
throw (RuntimeException)t;
else
throw new GdxRuntimeException(t);
}
}
};
代码示例来源:origin: mstojcevich/Radix
public void handleCriticalException(Exception ex) {
ex.printStackTrace();
this.done = true;
Gdx.input.setCursorCatched(false);
if(!android) {
JOptionPane.showMessageDialog(null, GAME_TITLE + " crashed. " + String.valueOf(ex), GAME_TITLE + " crashed", JOptionPane.ERROR_MESSAGE);
}
}
代码示例来源:origin: mstojcevich/Radix
public void setCurrentScreen(GuiScreen screen) {
if (currentScreen == null) {
currentScreen = screen;
screen.init();
} else if (!currentScreen.equals(screen)) {
currentScreen.finish();
currentScreen = screen;
screen.init();
}
if (screen.equals(hud) && !android) {
Gdx.input.setCursorCatched(true);
} else {
Gdx.input.setCursorCatched(false);
}
}
代码示例来源:origin: com.badlogicgames.gdx/gdx-backend-lwjgl
@Override
public void run () {
graphics.setVSync(graphics.config.vSyncEnabled);
try {
LwjglApplication.this.mainLoop();
} catch (Throwable t) {
if (audio != null) audio.dispose();
Gdx.input.setCursorCatched(false);
if (t instanceof RuntimeException)
throw (RuntimeException)t;
else
throw new GdxRuntimeException(t);
}
}
};
代码示例来源:origin: org.mini2Dx/mini2Dx-desktop
@Override
public void run() {
graphics.setVSync(graphics.config.vSyncEnabled);
try {
DesktopMini2DxGame.this.executeGame();
} catch (Throwable t) {
if (audio != null)
audio.dispose();
Gdx.input.setCursorCatched(false);
if (t instanceof RuntimeException)
throw (RuntimeException) t;
else
throw new GdxRuntimeException(t);
}
}
};
代码示例来源:origin: mstojcevich/Radix
done = true;
e.printStackTrace();
Gdx.input.setCursorCatched(false);
Gdx.app.exit();
内容来源于网络,如有侵权,请联系作者删除!