Example usage for com.badlogic.gdx.maps MapLayers MapLayers

List of usage examples for com.badlogic.gdx.maps MapLayers MapLayers

Introduction

In this page you can find the example usage for com.badlogic.gdx.maps MapLayers MapLayers.

Prototype

MapLayers

Source Link

Usage

From source file:managers.MapManager.java

private void initializeMapLayers(GameData gameData) {
    mapLayers = map.getLayers();//from   w  ww  .  ja v a2 s  .com
    groundLayers = new MapLayers();
    prop = map.getProperties();
    mapHeight = prop.get("height", Integer.class) * prop.get("tileheight", Integer.class);
    mapWidth = prop.get("width", Integer.class) * prop.get("tilewidth", Integer.class);
    ;

    int mapPixelWidth = prop.get("width", Integer.class) * prop.get("tilewidth", Integer.class);
    int mapPixelHeight = prop.get("height", Integer.class) * prop.get("tileheight", Integer.class);
    gameData.setMapHeight(mapPixelHeight);
    gameData.setMapWidth(mapPixelWidth);
    currentLayer = (TiledMapTileLayer) mapLayers.get(0);

    for (int i = 1; i < mapLayers.getCount(); i++) {
        mapLayers.get(i).setVisible(false);
        groundLayers.add(mapLayers.get(i));
    }
}