@Override public void clicked (InputEvent event, float x, float y) { super.clicked(event, x, y); if (isWindowed) { isWindowed = false; changeModeButton.setText(fullScreenInstructions); Gdx.graphics.setFullscreenMode(Gdx.graphics.getDisplayMode()); } else { isWindowed = true; changeModeButton.setText(windowedInstructions); Gdx.graphics.setWindowedMode(Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); } } });
Gdx.graphics.setWindowedMode(480, 320); batch.getProjectionMatrix().setToOrtho2D(0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); Gdx.gl.glViewport(0, 0, Gdx.graphics.getBackBufferWidth(), Gdx.graphics.getBackBufferHeight());
public boolean apply() { boolean wasApplied = Gdx.graphics.setWindowedMode(width, height); if (wasApplied) { Gdx.gl.glViewport(0, 0, width, height); /* Gdx.gl.glMatr(GL11.GL_PROJECTION); Gdx.gl.glLoadIdentity(); Gdx.gl.glOrthof(0.0f, (float) width, height, 0.0f, -9999.0f, 9999.0f); Gdx.gl.glMatrixMode(GL11.GL_MODELVIEW); Gdx.gl.glLoadIdentity();*/ } return wasApplied; }
public Main(Editor editor, LwjglApplicationConfiguration cfg) { super(editor, cfg); Gdx.graphics.setWindowedMode(Math.max((int) (Gdx.graphics.getDisplayMode().width * 0.9), 1920 / 2), Math.max((int) (Gdx.graphics.getDisplayMode().height * 0.9), 1080 / 2)); }
public void toggleFullScreen() { if (!fullscreen) { Gdx.graphics.setFullscreenMode(Gdx.graphics.getDisplayMode()); fullscreen = true; } else { Gdx.graphics.setWindowedMode(w.getWidth(), w.getHeight()); fullscreen = false; } }
public static void fullscreen( boolean value ) { if (value) { put(KEY_WINDOW_FULLSCREEN, true); Gdx.graphics.setFullscreenMode(Gdx.graphics.getDisplayMode()); } else { int w = getInt(KEY_WINDOW_WIDTH, DEFAULT_WINDOW_WIDTH); int h = getInt(KEY_WINDOW_HEIGHT, DEFAULT_WINDOW_HEIGHT); put(KEY_WINDOW_FULLSCREEN, false); Gdx.graphics.setWindowedMode(w, h); } }
public void toggleFullscreen() { if (Gdx.graphics.isFullscreen()) { Gdx.app.debug(TAG, "Disabling fullscreen w=" + WIDTH + ", h=" + HEIGHT); Gdx.graphics.setWindowedMode(WIDTH, HEIGHT); } else { Gdx.app.debug(TAG, "Enabling fullscreen w=" + Gdx.graphics.getDisplayMode().width + ", h=" + Gdx.graphics.getDisplayMode().height); Gdx.graphics.setFullscreenMode(Gdx.graphics.getDisplayMode()); } }
int height = GlobalConf.screen.SCREEN_HEIGHT; boolean good = Gdx.graphics.setWindowedMode(width, height); if (!good) { logger.error(I18n.bundle.format("notif.error", I18n.bundle.get("gui.windowed")));
Gdx.graphics.setWindowedMode(Math.max((int) (Gdx.graphics.getDisplayMode().width * 0.9), 1920 / 2), Math.max((int) (Gdx.graphics.getDisplayMode().height * 0.9), 1080 / 2));