@Override public void setCursorCatched (boolean catched) { input.setCursorCatched(catched); }
@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; }
@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); } } };
@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); } } };
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); } }
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); } }
@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); } } };
@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); } } };
done = true; e.printStackTrace(); Gdx.input.setCursorCatched(false); Gdx.app.exit();