Created
July 18, 2013 15:43
-
-
Save smaspe/6030401 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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