Search in sources :

Example 11 with MapLayer

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

the class Box2DMapObjectParser method load.

/**
     * creates the given {@link Map Map's} {@link com.badlogic.gdx.maps.MapObjects} in the given {@link World}
     *
     * @param world the {@link World} to create the {@link com.badlogic.gdx.maps.MapObjects} of the given {@link Map} in
     * @param map   the {@link Map} which {@link com.badlogic.gdx.maps.MapObjects} to create in the given {@link World}
     * @return the given {@link World} with the parsed {@link com.badlogic.gdx.maps.MapObjects} of the given {@link Map} created in it
     */
public World load(World world, Map map) {
    if (!ignoreMapUnitScale)
        unitScale = getProperty(map.getProperties(), aliases.unitScale, unitScale);
    box2dObjectFactory.setUnitScale(unitScale);
    tileWidth = getProperty(map.getProperties(), "tilewidth", (int) tileWidth);
    tileHeight = getProperty(map.getProperties(), "tileheight", (int) tileHeight);
    for (MapLayer mapLayer : map.getLayers()) load(world, mapLayer);
    return world;
}
Also used : MapLayer(com.badlogic.gdx.maps.MapLayer)

Aggregations

MapLayer (com.badlogic.gdx.maps.MapLayer)11 TiledMapTileLayer (com.badlogic.gdx.maps.tiled.TiledMapTileLayer)6 TiledMapImageLayer (com.badlogic.gdx.maps.tiled.TiledMapImageLayer)4 MapLayers (com.badlogic.gdx.maps.MapLayers)2 MapObject (com.badlogic.gdx.maps.MapObject)2 TiledMapTile (com.badlogic.gdx.maps.tiled.TiledMapTile)2 AssetManager (com.badlogic.gdx.assets.AssetManager)1 InternalFileHandleResolver (com.badlogic.gdx.assets.loaders.resolvers.InternalFileHandleResolver)1 OrthographicCamera (com.badlogic.gdx.graphics.OrthographicCamera)1 BitmapFont (com.badlogic.gdx.graphics.g2d.BitmapFont)1 SpriteBatch (com.badlogic.gdx.graphics.g2d.SpriteBatch)1 TextureRegion (com.badlogic.gdx.graphics.g2d.TextureRegion)1 MapObjects (com.badlogic.gdx.maps.MapObjects)1 EllipseMapObject (com.badlogic.gdx.maps.objects.EllipseMapObject)1 PolygonMapObject (com.badlogic.gdx.maps.objects.PolygonMapObject)1 RectangleMapObject (com.badlogic.gdx.maps.objects.RectangleMapObject)1 TextureMapObject (com.badlogic.gdx.maps.objects.TextureMapObject)1 Cell (com.badlogic.gdx.maps.tiled.TiledMapTileLayer.Cell)1 TiledMapTileSet (com.badlogic.gdx.maps.tiled.TiledMapTileSet)1 TmxMapLoader (com.badlogic.gdx.maps.tiled.TmxMapLoader)1