Example usage for com.badlogic.gdx.graphics.g2d.tiled SimpleTileAtlas SimpleTileAtlas

List of usage examples for com.badlogic.gdx.graphics.g2d.tiled SimpleTileAtlas SimpleTileAtlas

Introduction

In this page you can find the example usage for com.badlogic.gdx.graphics.g2d.tiled SimpleTileAtlas SimpleTileAtlas.

Prototype

public SimpleTileAtlas(TiledMap map, FileHandle inputDir) 

Source Link

Document

Creates a TileAtlas for use with TileMapRenderer .

Usage

From source file:com.baldwin.libgdx.commons.SimpleTiledMapHelper.java

License:Apache License

/**
 * Loads the requested tmx map file in to the helper.
 * /*from w w w. j  ava  2  s .  c o  m*/
 * @param tmxFile
 */
public void loadMap(String tmxFile) {
    if (resourceDirectory == null) {
        throw new IllegalStateException("loadMap() called out of sequence");
    }

    map = TiledLoader.createMap(Gdx.files.internal(tmxFile));
    tileAtlas = new SimpleTileAtlas(map, resourceDirectory);

    tileMapRenderer = new TileMapRenderer(map, tileAtlas, 16, 16);
}