コード例 #1
0
ファイル: StageListener.java プロジェクト: prasaduma/Catroid
  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();
  }
コード例 #2
0
ファイル: StageListener.java プロジェクト: prasaduma/Catroid
  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);
    }
  }