Example usage for com.badlogic.gdx.tools.texturepacker TexturePackerFileProcessor setComparator

List of usage examples for com.badlogic.gdx.tools.texturepacker TexturePackerFileProcessor setComparator

Introduction

In this page you can find the example usage for com.badlogic.gdx.tools.texturepacker TexturePackerFileProcessor setComparator.

Prototype

public FileProcessor setComparator(Comparator<File> comparator) 

Source Link

Document

Sets the comparator for #processDir(Entry,ArrayList) .

Usage

From source file:com.kotcrab.vis.editor.util.gdx.VisTexturePacker.java

License:Apache License

static public void process(TexturePacker.Settings settings, String input, String output, String packFileName,
        FilenameFilter filter) {//from  w w  w .  j  a  va  2 s. c  o  m
    try {
        TexturePackerFileProcessor processor = new TexturePackerFileProcessor(settings, packFileName);
        processor.setInputFilter(filter);
        // Sort input files by name to avoid platform-dependent atlas output changes.
        processor.setComparator((file1, file2) -> file1.getName().compareTo(file2.getName()));
        processor.process(new File(input), new File(output));
    } catch (Exception ex) {
        throw new RuntimeException("Error packing images.", ex);
    }
}