@Override public void resize (int width, int height) { super.resize(width, height); ui.getViewport().setWorldSize(width, height); ui.getViewport().update(width, height, true); }
@Override public void resize (int width, int height) { Gdx.input.setInputProcessor(new InputMultiplexer(ui, cameraInputController)); Gdx.gl.glViewport(0, 0, width, height); worldCamera.viewportWidth = width; worldCamera.viewportHeight = height; worldCamera.update(); ui.getViewport().setWorldSize(width, height); ui.getViewport().update(width, height, true); }
@Override public void resize (int width, int height) { Gdx.input.setInputProcessor(new InputMultiplexer(ui, cameraInputController)); Gdx.gl.glViewport(0, 0, width, height); worldCamera.viewportWidth = width; worldCamera.viewportHeight = height; worldCamera.update(); ui.getViewport().setWorldSize(width, height); ui.getViewport().update(width, height, true); }
@Override public void setWorldSize(float worldWidth, float worldHeight) { super.setWorldSize(worldWidth, worldHeight); // The minimum height aspect is 4:3, the maximum is the world aspect minWorldWidth = Math.min(worldHeight * 4f / 3f, worldWidth); // The minimum width aspect is 16:9, the maximum is the world aspect minWorldHeight = Math.min(worldWidth * 9f / 16f, worldHeight); maxWorldWidth = worldWidth; maxWorldHeight = worldHeight; }
@Override public void resize(int width, int height) { float aspect = width / height; float bgAspect = (float)tex.getWidth() / (float)tex.getHeight(); if(aspect < bgAspect) viewport.setWorldSize(width, (int)(width / bgAspect)); else viewport.setWorldSize((int)(height * bgAspect), height); viewport.update(width, height, true); }
super.setWorldSize(worldWidth, worldHeight);
@Override public void resize (int width, int height) { Gdx.input.setInputProcessor(new InputMultiplexer(ui, cameraInputController)); Gdx.gl.glViewport(0, 0, width, height); worldCamera.viewportWidth = width; worldCamera.viewportHeight = height; worldCamera.update(); ui.getViewport().setWorldSize(width, height); ui.getViewport().update(width, height, true); }
@Override public void render(SceneGraphRenderer sgr, ICamera camera, double t, int rw, int rh, FrameBuffer fb, PostProcessBean ppb) { boolean postproc = postprocessCapture(ppb, fb, rw, rh); // Viewport extendViewport.setCamera(camera.getCamera()); extendViewport.setWorldSize(rw, rh); extendViewport.setScreenSize(rw, rh); extendViewport.apply(); // Render sgr.renderScene(camera, t, rc); // Uncomment this to show the shadow map // if (GlobalConf.scene.SHADOW_MAPPING) { // // Render shadow map // int s = GlobalConf.scene.SHADOW_MAPPING_RESOLUTION; // sb.begin(); // for (int i = 0; i < sgr.shadowMapFb.length; i++) { // sb.draw(sgr.shadowMapFb[i].getColorBufferTexture(), 0, 0, s, s); // } // sb.end(); // } postprocessRender(ppb, fb, postproc, camera, rw, rh); }
@Override public void resize(int width, int height) { final World world = ui.getWorld(); if (!world.isDisposed()) { viewport.setWorldSize(world.getWidth(), world.getHeight()); viewport.update(width, height, true); world.resize(viewport.getWorldWidth(), viewport.getWorldHeight()); } else { viewport.setWorldSize(width, height); viewport.update(width, height, true); } updateUI(); pie.resize(viewport.getScreenWidth(), viewport.getScreenHeight()); inventoryUI.resize(viewport.getScreenWidth(), viewport.getScreenHeight()); inventoryButton.resize(width, height); pointer.resize(width, height); float size = DPIUtils.getPrefButtonSize(); float margin = DPIUtils.getMarginSize(); menuButton.setSize(size, size); menuButton.setPosition(stage.getViewport().getScreenWidth() - menuButton.getWidth() - margin, stage.getViewport().getScreenHeight() - menuButton.getHeight() - margin); }
@Override public void resize(int width, int height) { final World world = ui.getWorld(); if (!world.isDisposed()) { screenViewport.setWorldSize(world.getWidth(), world.getHeight()); screenViewport.update(width, height, true); worldViewport.setScreenBounds(screenViewport.getScreenX(), screenViewport.getScreenY(), screenViewport.getScreenWidth(), screenViewport.getScreenHeight()); world.resize(screenViewport.getWorldWidth(), screenViewport.getWorldHeight()); } pointer.resize(); verbUI.setSize(screenViewport.getScreenWidth(), screenViewport.getScreenHeight() * UI_SCREEN_PERCENT); float size = DPIUtils.getPrefButtonSize(); float margin = DPIUtils.getMarginSize(); menuButton.setSize(size, size); menuButton.setPosition(stage.getViewport().getScreenWidth() - menuButton.getWidth() - margin, stage.getViewport().getScreenHeight() - menuButton.getHeight() - margin); }
aiViewport.setWorldSize(indicatorw, indicatorh); aiViewport.setScreenBounds((int) indicatorx, (int) indicatory, (int) indicatorw, (int) indicatorh); aiViewport.apply(); aiViewport.setWorldSize(rw, rh); aiViewport.setScreenBounds(0, 0, rw, rh); aiViewport.apply();
extendViewport.setWorldSize(rw, rh); extendViewport.setScreenBounds(0, 0, rw, rh); extendViewport.apply(); viewport.setWorldSize(srw, srh);
viewport.setWorldSize(wh, wh); viewport.setScreenBounds(0, 0, wh, wh); viewport.apply();