Example #1
0
  private void initScreenMode() {
    switch (project.getScreenMode()) {
      case STRETCH:
        stage.setViewport(virtualWidth, virtualHeight, false);
        screenshotWidth = ScreenValues.SCREEN_WIDTH;
        screenshotHeight = ScreenValues.SCREEN_HEIGHT;
        screenshotX = 0;
        screenshotY = 0;
        break;

      case MAXIMIZE:
        stage.setViewport(virtualWidth, virtualHeight, true);
        screenshotWidth = maximizeViewPortWidth;
        screenshotHeight = maximizeViewPortHeight;
        screenshotX = maximizeViewPortX;
        screenshotY = maximizeViewPortY;
        break;

      default:
        break;
    }
    camera = (OrthographicCamera) stage.getCamera();
    camera.position.set(0, 0, 0);
    camera.update();
  }
Example #2
0
  public void toggleScreenMode() {
    switch (project.getScreenMode()) {
      case MAXIMIZE:
        project.setScreenMode(ScreenModes.STRETCH);
        break;
      case STRETCH:
        project.setScreenMode(ScreenModes.MAXIMIZE);
        break;
    }

    initScreenMode();

    if (checkIfAutomaticScreenshotShouldBeTaken) {
      makeAutomaticScreenshot = project.manualScreenshotExists(SCREENSHOT_MANUAL_FILE_NAME);
    }
  }