}
ImagePacker packer = new ImagePacker(margin, padding);
for (Texture eachTexture : allTextures) {
ImageData data = new ImageData(animationIndex, eachTexture);
packer.addItem(data);
}
output.setNameFormat(eachAnimation.name + "-", null);
packer.setOutput(output);
packer.process(maxWidth, maxHeight, true);
animationIndex++;
}
} else {
Set<Texture> allTextures = new HashSet<Texture>();
for (Animation eachAnimation : animations.getList()) {
for (Sprite eachSprite : eachAnimation.getSprites()) {
allTextures.add(eachSprite.texture);
}
}
ImagePacker packer = new ImagePacker(margin, padding);
for (Texture eachTexture : allTextures) {
ImageData data = new ImageData(eachTexture);
packer.addItem(data);
}
output.setNameFormat("atlas-", null);