Package com.badlogic.gdx.maps.tiled.tiles

Examples of com.badlogic.gdx.maps.tiled.tiles.AnimatedTiledMapTile


        frameTiles.add((StaticTiledMapTile) tile);
      }
    }
   
    // Crea un tile animado y le asigna las propiedades de todos los tiles que forman la animación
    AnimatedTiledMapTile animatedTile = new AnimatedTiledMapTile(1 / 4f, frameTiles);
    // El Tile animado tiene que heredar todas las propiedades de los tiles estáticos que lo forman
    for (TiledMapTile tile : frameTiles)
      animatedTile.getProperties().putAll(tile.getProperties());
   
    // Coloca el tile animado donde haya un tile del mismo tipo pero estático
    for (int x = 0; x < collisionLayer.getWidth(); x++) {
      for (int y = 0; y < collisionLayer.getHeight(); y++) {
        Cell cell = collisionLayer.getCell(x, y);
View Full Code Here


              } else if (frameName.equals("Static")) {
                frameTiles.add((StaticTiledMapTile)currentTileSet.getTile(firstgid + frame.getIntAttribute("Index")));
              }
            }
            Cell cell = new Cell();
            cell.setTile(new AnimatedTiledMapTile(interval / 1000f, frameTiles));
            layer.setCell(x++, y, cell); // TODO: Reuse existing animated tiles
          }
        }
      }
      map.getLayers().add(layer);
View Full Code Here

            for (Element frameElement: animationElement.getChildrenByName("frame")) {
              staticTiles.add((StaticTiledMapTile) tileset.getTile(firstgid + frameElement.getIntAttribute("tileid")));
              intervals.add(frameElement.getIntAttribute("duration"));
            }

            AnimatedTiledMapTile animatedTile = new AnimatedTiledMapTile(intervals, staticTiles);
            animatedTile.setId(tile.getId());
            animatedTiles.add(animatedTile);
            tile = animatedTile;
          }

          String terrain = tileElement.getAttribute("terrain", null);
View Full Code Here

TOP

Related Classes of com.badlogic.gdx.maps.tiled.tiles.AnimatedTiledMapTile

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.