Please explain to me where I am going wrong. Here is my code. I have been trying to load a level I designed in tile in LibGDX, but have been hit with
Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load dependencies of asset: level_1_better.tmx
Here is my TileTest.java file
package com.mygdx.game.mytile;
import com.badlogic.gdx.ApplicationAdapter;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.assets.AssetManager;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.maps.MapProperties;
import com.badlogic.gdx.maps.tiled.TiledMap;
import com.badlogic.gdx.maps.tiled.TiledMapRenderer;
import com.badlogic.gdx.maps.tiled.TmxMapLoader;
import com.badlogic.gdx.maps.tiled.renderers.OrthogonalTiledMapRenderer;
public class TileTest extends ApplicationAdapter {
private TiledMap map;
private TiledMapRenderer renderer;
private OrthographicCamera camera;
private AssetManager manager;
private Integer tileWidth;
private Integer tileHeight;
private Integer mapWidthInTiles;
private Integer mapHeightInTiles;
private int mapWidthInPixels;
private int mapHeightInPixels;
@Override
public void create () {
manager = new AssetManager();
manager.setLoader(TiledMap.class, new TmxMapLoader());
manager.load("level_1_better.tmx", TiledMap.class);
manager.finishLoading();
map = manager.get("level_1_better.tmx", TiledMap.class);
MapProperties properties = map.getProperties();
tileWidth = properties.get("tilewidth", Integer.class);
tileHeight = properties.get("tileheight", Integer.class);
mapWidthInTiles = properties.get("width", Integer.class);
mapHeightInTiles = properties.get("height", Integer.class);
mapWidthInPixels = mapWidthInTiles * tileWidth;
mapHeightInPixels = mapHeightInTiles * tileHeight;
camera = new OrthographicCamera(320.f, 180.f);
camera.position.x = mapWidthInPixels * .5f;
camera.position.y = mapHeightInPixels * .35f;
renderer = new OrthogonalTiledMapRenderer(map);
}
@Override
public void render () {
Gdx.gl.glClearColor(.5f, .7f, .9f, 1);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
camera.update();
renderer.setView(camera);
renderer.render();
}
@Override
public void dispose () {
manager.dispose();
}
}
My file level_1_better.tmx is in the assets folder's root directory. And hyptosis_tile-art-batch-1.png is the sprite sheet it is referencing to create the tile level.