예제 #1
0
  protected void fontsLoad(File directory) {
    for (File curFile : directory.listFiles()) {
      String filename = curFile.getName();
      if (filename.endsWith(".fnt")) {
        filename = filename.substring(0, filename.length() - ".fnt".length());
        BitmapFont font = new BitmapFont(filename);
        font.loadFromFile(curFile);
        addItem(font);
      }
    }

    setClean();
  }
예제 #2
0
  protected void fontsSave(File directory) {
    updateItem(this);

    for (Leaf<DataItem> item : getItems()) {
      System.out.println(item.getName() + ", " + item.isDirty());

      if (item.isDirty()) {
        System.out.println(directory.getAbsolutePath() + File.separator + item.getName() + ".fnt");
        String filename = directory.getAbsolutePath() + File.separator + item.getName() + ".fnt";
        ((BitmapFont) item).saveToFile(new File(filename));
      }
    }

    setClean();
  }