Search in sources :

Example 6 with TiledMap

use of com.badlogic.gdx.maps.tiled.TiledMap in project Entitas-Java by Rubentxu.

the class MapEntityParser method load.

public void load(String scene) {
    TiledMap map = loader.load(scene);
    MapObjects characters = map.getLayers().get("Characters").getObjects();
    MapObjects statics = map.getLayers().get("Statics").getObjects();
    for (MapObject object : characters) {
        String type = object.getProperties().get(aliases.Character, "", String.class);
        if (type != null)
            baseSceneManager.createEntity(type);
    }
    for (MapObject object : statics) {
        String type = object.getProperties().get(aliases.Statics, "", String.class);
        if (type != null)
            baseSceneManager.createEntity(type);
    }
}
Also used : TiledMap(com.badlogic.gdx.maps.tiled.TiledMap) MapObjects(com.badlogic.gdx.maps.MapObjects) MapObject(com.badlogic.gdx.maps.MapObject)

Aggregations

TiledMap (com.badlogic.gdx.maps.tiled.TiledMap)6 TiledMapTileLayer (com.badlogic.gdx.maps.tiled.TiledMapTileLayer)3 Cell (com.badlogic.gdx.maps.tiled.TiledMapTileLayer.Cell)3 OrthographicCamera (com.badlogic.gdx.graphics.OrthographicCamera)2 Texture (com.badlogic.gdx.graphics.Texture)2 TextureRegion (com.badlogic.gdx.graphics.g2d.TextureRegion)2 MapLayers (com.badlogic.gdx.maps.MapLayers)2 OrthogonalTiledMapRenderer (com.badlogic.gdx.maps.tiled.renderers.OrthogonalTiledMapRenderer)2 StaticTiledMapTile (com.badlogic.gdx.maps.tiled.tiles.StaticTiledMapTile)2 OrthoCamController (com.badlogic.gdx.tests.utils.OrthoCamController)2 Tiled (ilargia.egdx.logicbricks.component.scene.Tiled)2 BitmapFont (com.badlogic.gdx.graphics.g2d.BitmapFont)1 SpriteBatch (com.badlogic.gdx.graphics.g2d.SpriteBatch)1 MapObject (com.badlogic.gdx.maps.MapObject)1 MapObjects (com.badlogic.gdx.maps.MapObjects)1 TiledMapTile (com.badlogic.gdx.maps.tiled.TiledMapTile)1 HexagonalTiledMapRenderer (com.badlogic.gdx.maps.tiled.renderers.HexagonalTiledMapRenderer)1 Point (java.awt.Point)1