Package org.terasology.rendering.assets.texture.subtexture

Examples of org.terasology.rendering.assets.texture.subtexture.SubtextureData


        final Vector2f texSize = new Vector2f(getRelativeTileSize(), getRelativeTileSize());
        tileIndexes.forEachEntry(new TObjectIntProcedure<AssetUri>() {
            @Override
            public boolean execute(AssetUri tileUri, int index) {
                Vector2f coords = getTexCoords(index);
                SubtextureData subtextureData = new SubtextureData(texture, Rect2f.createFromMinAndSize(coords, texSize));

                Map<Name, SubtextureData> textureAtlas = textureAtlases.get(tileUri.getModuleName());
                if (textureAtlas == null) {
                    textureAtlas = Maps.newHashMap();
                    textureAtlases.put(tileUri.getModuleName(), textureAtlas);
View Full Code Here


            return;
        }
        Vector2f min = new Vector2f((float) freeform.getMin().x / size.x, (float) freeform.getMin().y / size.y);
        if (freeform.getSize() != null) {
            Vector2f itemSize = new Vector2f((float) freeform.getSize().x / size.x, (float) freeform.getSize().y / size.y);
            out.put(new Name(freeform.getName()), new SubtextureData(texture, Rect2f.createFromMinAndSize(min, itemSize)));
        } else if (freeform.getMax() != null) {
            Vector2f max = new Vector2f((float) freeform.getMax().x / size.x, (float) freeform.getMax().y / size.y);
            out.put(new Name(freeform.getName()), new SubtextureData(texture, Rect2f.createFromMinAndMax(min, max)));
        }
    }
View Full Code Here

            if (!name.isEmpty()) {
                Vector2f pos = new Vector2f(offset);
                pos.x += tileX * tileSize.x;
                pos.y += tileY * tileSize.y;
                Rect2f tileLocation = Rect2f.createFromMinAndSize(offset.x + tileX * tileSize.x, offset.y + tileY * tileSize.y, tileSize.x, tileSize.y);
                out.put(new Name(name), new SubtextureData(texture, tileLocation));
            }

            tileX++;
            if (tileX == grid.getGridDimensions().x) {
                tileX = 0;
View Full Code Here

TOP

Related Classes of org.terasology.rendering.assets.texture.subtexture.SubtextureData

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.