Package tripleplay.util

Examples of tripleplay.util.TexturePacker$Renderer


     * 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());
View Full Code Here

TOP

Related Classes of tripleplay.util.TexturePacker$Renderer

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.