Search in sources :

Example 6 with TmxMapLoader

use of com.badlogic.gdx.maps.tiled.TmxMapLoader in project libgdx by libgdx.

the class TiledMapObjectLoadingTest method create.

@Override
public void create() {
    float w = Gdx.graphics.getWidth();
    float h = Gdx.graphics.getHeight();
    camera = new OrthographicCamera();
    camera.setToOrtho(false, (w / h) * 100, 100);
    camera.zoom = 2;
    camera.update();
    cameraController = new OrthoCamController(camera);
    Gdx.input.setInputProcessor(cameraController);
    font = new BitmapFont();
    batch = new SpriteBatch();
    map = new TmxMapLoader().load("data/maps/tiled-objects/test-load-mapobjects.tmx");
    MapProperties properties = map.getProperties();
    shapeRenderer = new ShapeRenderer();
}
Also used : TmxMapLoader(com.badlogic.gdx.maps.tiled.TmxMapLoader) OrthographicCamera(com.badlogic.gdx.graphics.OrthographicCamera) OrthoCamController(com.badlogic.gdx.tests.utils.OrthoCamController) MapProperties(com.badlogic.gdx.maps.MapProperties) BitmapFont(com.badlogic.gdx.graphics.g2d.BitmapFont) SpriteBatch(com.badlogic.gdx.graphics.g2d.SpriteBatch) ShapeRenderer(com.badlogic.gdx.graphics.glutils.ShapeRenderer)

Aggregations

OrthographicCamera (com.badlogic.gdx.graphics.OrthographicCamera)6 TmxMapLoader (com.badlogic.gdx.maps.tiled.TmxMapLoader)6 BitmapFont (com.badlogic.gdx.graphics.g2d.BitmapFont)5 SpriteBatch (com.badlogic.gdx.graphics.g2d.SpriteBatch)5 OrthoCamController (com.badlogic.gdx.tests.utils.OrthoCamController)5 ShapeRenderer (com.badlogic.gdx.graphics.glutils.ShapeRenderer)3 OrthogonalTiledMapRenderer (com.badlogic.gdx.maps.tiled.renderers.OrthogonalTiledMapRenderer)3 AssetManager (com.badlogic.gdx.assets.AssetManager)2 InternalFileHandleResolver (com.badlogic.gdx.assets.loaders.resolvers.InternalFileHandleResolver)2 IsometricTiledMapRenderer (com.badlogic.gdx.maps.tiled.renderers.IsometricTiledMapRenderer)2 Texture (com.badlogic.gdx.graphics.Texture)1 Animation (com.badlogic.gdx.graphics.g2d.Animation)1 TextureRegion (com.badlogic.gdx.graphics.g2d.TextureRegion)1 MapLayer (com.badlogic.gdx.maps.MapLayer)1 MapProperties (com.badlogic.gdx.maps.MapProperties)1 TiledMapTile (com.badlogic.gdx.maps.tiled.TiledMapTile)1 TiledMapTileSet (com.badlogic.gdx.maps.tiled.TiledMapTileSet)1