* that their symbols point at the new atlases. */
public static void pack (Collection<Library> libs) {
List<Library> list = new ArrayList<Library>(libs);
// Add all texture symbols to the packer
TexturePacker packer = new TexturePacker();
for (int ii = 0, ll = list.size(); ii < ll; ++ii) {
Library lib = list.get(ii);
for (Symbol symbol : lib.symbols.values()) {
if (symbol instanceof Texture.Symbol) {
packer.add(ii+":"+symbol.name(), ((Texture.Symbol)symbol).region);
}
}
}
// Pack and update all texture symbols to the new regions
Map<String,Image.Region> images = packer.pack();
for (int ii = 0, ll = list.size(); ii < ll; ++ii) {
Library lib = list.get(ii);
for (Symbol symbol : lib.symbols.values()) {
if (symbol instanceof Texture.Symbol) {
((Texture.Symbol)symbol).region = images.get(ii+":"+symbol.name());