Package com.badlogic.gdx.maps.tiled

Examples of com.badlogic.gdx.maps.tiled.TiledMapTileLayer


        while (it.hasNext()) {
          MapLayer layer = it.next();

          // some layers can be plain MapLayer instances (ie. object groups), just ignore them
          if (layer instanceof TiledMapTileLayer) {
            TiledMapTileLayer tlayer = (TiledMapTileLayer)layer;

            for (int y = 0; y < mapHeight; ++y) {
              for (int x = 0; x < mapWidth; ++x) {
                if (tlayer.getCell(x, y) != null) {
                  int tileid = tlayer.getCell(x, y).getTile().getId() & ~0xE0000000;
                  String tilesetName = tilesetNameFromTileId(map, tileid);
                  IntArray usedIds = getUsedIdsBucket(tilesetName, bucketSize);
                  usedIds.add(tileid);

                  // track this tileset to be packed if not already tracked
View Full Code Here


        Log.info("Have map: "+(map != null));
        Log.info("Have map2: "+(map.getTiledMapGDX() != null));
        Log.info("Have map3: "+(map.getTiledMapGDX().gdxMap != null));
        map.world = new World(new Vector2(), true);
       
TiledMapTileLayer collisionLayer = (TiledMapTileLayer) map.getTiledMapGDX().gdxMap.getLayers().get(Detonator.INSTANCE.obstaclesLayerCode);
       
        if(collisionLayer != null){
            for(int y = 0; y < collisionLayer.getHeight(); y++){
                for(int x = 0; x < collisionLayer.getWidth(); x++){
                    String collision = "false";
                    TiledMapTileLayer.Cell tile = collisionLayer.getCell(x, y);
                    if(tile != null){
                        collision = "true";
                        tileProps = tile.getTile().getProperties();
                        if (tileProps.containsKey("iswall")){
                            collision = tile.getTile().getProperties().get("collision", String.class);
View Full Code Here

TOP

Related Classes of com.badlogic.gdx.maps.tiled.TiledMapTileLayer

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.