Skip to content

Instantly share code, notes, and snippets.

@smaspe
Created July 18, 2013 15:43
Show Gist options
  • Save smaspe/6030401 to your computer and use it in GitHub Desktop.
Save smaspe/6030401 to your computer and use it in GitHub Desktop.
public void create() {
float w = Gdx.graphics.getWidth();
float h = Gdx.graphics.getHeight();
TiledMap map = new TmxMapLoader().load("data/goban19.tmx");
renderer = new OrthogonalTiledMapRenderer(map, unitScale);
camera = new OrthographicCamera();
camera.setToOrtho(true, w * unitScale, h * unitScale);
WIDTH = ((TiledMapTileLayer) map.getLayers().get(0)).getWidth();
HEIGHT = ((TiledMapTileLayer) map.getLayers().get(0)).getHeight();
camera.position.x = WIDTH / 2;
camera.position.y = HEIGHT / 2;
camera.update();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment