So I've recently began to learn how to use LibGDX and I'm now trying to load a tiled map. I've been reading
this.
So I have my TMX file located at
assets/maps/tilemapxml.tmx along with the
.png and
.pack files. I'm trying to load it via the AssetManager, using this code:
1 2 3 4 5 6 7
| AssetManager manager = new AssetManager(); manager.setLoader(TiledMap.class, new TmxMapLoader( new InternalFileHandleResolver())); manager.load(mapFile, TiledMap.class); manager.finishLoading();
map = manager.get(mapFile); |
Then I'm trying to render the map how it says to:
1
| new OrthogonalTiledMapRenderer(map, unitScale); |
But I get a lot of errors like so;
1 2
| Couldn't load dependencies of asset: maps/tilemapxml.tmx Error parsing file: maps/tilemapxml.tmx |
Q1: Am I doing anything wrong at the moment??
Q2: I'm confused and I feel like I'm missing a lot of code here. What else do I need to do?