Esempio n. 1
0
  public boolean manualScreenshotExists(String manualScreenshotName) {

    String path = Utils.buildProjectPath(getName()) + "/" + manualScreenshotName;
    File manualScreenShot = new File(path);
    if (manualScreenShot.exists()) {
      return false;
    }
    return true;
  }
Esempio n. 2
0
  @Override
  public void create() {
    font = new BitmapFont();
    font.setColor(1f, 0f, 0.05f, 1f);
    font.setScale(1.2f);

    project = ProjectManager.getInstance().getCurrentProject();
    pathForScreenshot = Utils.buildProjectPath(project.getName()) + "/";

    virtualWidth = project.getXmlHeader().virtualScreenWidth;
    virtualHeight = project.getXmlHeader().virtualScreenHeight;

    virtualWidthHalf = virtualWidth / 2;
    virtualHeightHalf = virtualHeight / 2;

    stage = new Stage(virtualWidth, virtualHeight, true);
    batch = stage.getSpriteBatch();

    Gdx.gl.glViewport(0, 0, ScreenValues.SCREEN_WIDTH, ScreenValues.SCREEN_HEIGHT);
    initScreenMode();

    sprites = project.getSpriteList();
    for (Sprite sprite : sprites) {
      sprite.resetSprite();
      sprite.look.createBrightnessContrastShader();
      stage.addActor(sprite.look);
      sprite.resume();
    }

    passepartout =
        new Passepartout(
            ScreenValues.SCREEN_WIDTH,
            ScreenValues.SCREEN_HEIGHT,
            maximizeViewPortWidth,
            maximizeViewPortHeight,
            virtualWidth,
            virtualHeight);
    stage.addActor(passepartout);

    if (DEBUG) {
      OrthoCamController camController = new OrthoCamController(camera);
      InputMultiplexer multiplexer = new InputMultiplexer();
      multiplexer.addProcessor(camController);
      multiplexer.addProcessor(stage);
      Gdx.input.setInputProcessor(multiplexer);
      fpsLogger = new FPSLogger();
    } else {
      Gdx.input.setInputProcessor(stage);
    }

    axes = new Texture(Gdx.files.internal("stage/red_pixel.bmp"));
    skipFirstFrameForAutomaticScreenshot = true;
    if (checkIfAutomaticScreenshotShouldBeTaken) {
      makeAutomaticScreenshot = project.manualScreenshotExists(SCREENSHOT_MANUAL_FILE_NAME);
    }
  }
Esempio n. 3
0
 private String getPathToBackPackSoundDirectory() {
   Log.d("TAG", "getPathToBackPackSoundDirectory() called!");
   return Utils.buildPath(
       Utils.buildProjectPath(
           Constants.DEFAULT_ROOT
               + "/"
               + Constants.BACKPACK_DIRECTORY
               + "/"
               + Constants.BACKPACK_SOUND_DIRECTORY));
 }
Esempio n. 4
0
  public SoundInfo copySoundInfoForSprite(Sprite sprite) {
    SoundInfo cloneSoundInfo = new SoundInfo();

    cloneSoundInfo.name = this.name;

    try {
      cloneSoundInfo.fileName =
          StorageHandler.getInstance()
              .copySoundFile(
                  Utils.buildPath(
                      Utils.buildProjectPath(
                          ProjectManager.getInstance().getCurrentProject().getName()),
                      Constants.SOUND_DIRECTORY,
                      fileName))
              .getName();
    } catch (IOException ioException) {
      Log.e(TAG, Log.getStackTraceString(ioException));
    }

    return cloneSoundInfo;
  }
Esempio n. 5
0
 private String getPathToBackPackDirectory() {
   Log.d("TAG", "getPathToBackPackDirectory() called!");
   return Utils.buildPath(
       Utils.buildProjectPath(ProjectManager.getInstance().getCurrentProject().getName()),
       Constants.BACKPACK_DIRECTORY);
 }
Esempio n. 6
0
 private String getPathToSoundDirectory() {
   return Utils.buildPath(
       Utils.buildProjectPath(ProjectManager.getInstance().getCurrentProject().getName()),
       Constants.SOUND_DIRECTORY);
 }