Package com.badlogic.gdx.tools.texturepacker.TexturePacker

Examples of com.badlogic.gdx.tools.texturepacker.TexturePacker.Settings


   *           you have a "../" in the path of your tile sets! The output for these tile sets will be relative to the output
   *           directory. For example, if your output directory is "C:\mydir\output" and you have a tileset with the path
   *           "../tileset.png", the tileset will be output to "C:\mydir\" and the maps will be in "C:\mydir\output". args[2]:
   *           --strip-unused (optional, include to let the TiledMapPacker remove tiles which are not used. */
  public static void main (String[] args) {
    final Settings texturePackerSettings = new Settings();
    texturePackerSettings.paddingX = 2;
    texturePackerSettings.paddingY = 2;
    texturePackerSettings.edgePadding = true;
    texturePackerSettings.duplicatePadding = true;
    texturePackerSettings.bleed = true;
View Full Code Here


  private String packFileName;
  private File root;
  ArrayList<File> ignoreDirs = new ArrayList();

  public TexturePackerFileProcessor () {
    this(new Settings(), "pack.atlas");
  }
View Full Code Here

        return file1.toString().length() - file2.toString().length();
      }
    });
    for (File settingsFile : settingsFiles) {
      // Find first parent with settings, or use defaults.
      Settings settings = null;
      File parent = settingsFile.getParentFile();
      while (true) {
        if (parent.equals(root)) break;
        parent = parent.getParentFile();
        settings = dirToSettings.get(parent);
        if (settings != null) {
          settings = new Settings(settings);
          break;
        }
      }
      if (settings == null) settings = new Settings(defaultSettings);
      // Merge settings from current directory.
      merge(settings, settingsFile);
      dirToSettings.put(settingsFile.getParentFile(), settings);
    }
View Full Code Here

  public ArrayList<Entry> process (File[] files, File outputRoot) throws Exception {
    // Delete pack file and images.
    if (outputRoot.exists()) {
      // Load root settings to get scale.
      File settingsFile = new File(root, "pack.json");
      Settings rootSettings = defaultSettings;
      if (settingsFile.exists()) {
        rootSettings = new Settings(rootSettings);
        merge(rootSettings, settingsFile);
      }

      for (int i = 0, n = rootSettings.scale.length; i < n; i++) {
        FileProcessor deleteProcessor = new FileProcessor() {
          protected void processFile (Entry inputFile) throws Exception {
            inputFile.inputFile.delete();
          }
        };
        deleteProcessor.setRecursive(false);

        String scaledPackFileName = rootSettings.scaledPackFileName(packFileName, i);
        File packFile = new File(scaledPackFileName);

        String prefix = packFile.getName();
        int dotIndex = prefix.lastIndexOf('.');
        if (dotIndex != -1) prefix = prefix.substring(0, dotIndex);
View Full Code Here

  protected void processDir (Entry inputDir, ArrayList<Entry> files) throws Exception {
    if (ignoreDirs.contains(inputDir.inputFile)) return;

    // Find first parent with settings, or use defaults.
    Settings settings = null;
    File parent = inputDir.inputFile;
    while (true) {
      settings = dirToSettings.get(parent);
      if (settings != null) break;
      if (parent.equals(root)) break;
View Full Code Here

  }

  public void render () {
    Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);

    Settings settings = new Settings();
    settings.fast = false;
    settings.pot = false;
    settings.maxWidth = 1024;
    settings.maxHeight = 1024;
    settings.rotation = false;
View Full Code Here

TOP

Related Classes of com.badlogic.gdx.tools.texturepacker.TexturePacker.Settings

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.