Hey I’m currently playing around with the assetmanager of libgdx. I created a desktop project via the libgdx creator.
So I only have core and desktop in my project folder. Inside my core I got /assets/maps.
I now want to do something like:
Gdx.files.internal("core/maps/map1.tmx")
But it always cant find anything. I think because it is looking for my asset folder in the android module? Any ideas how I can point it to an asset folder inside core?
I read about it online and something pointed me at adapting the build.gradle?
This is my fullcode:
private TmxMapLoader mapLoader;
private AssetManager assetManager;
public TiledMapLoader(){
assetManager = new AssetManager();
assetManager.setLoader(TiledMap.class, new TmxMapLoader(new InternalFileHandleResolver()));
}
public TiledMap initializeTiledMap(int level) {
assetManager.load("maps/map_"+level+".tmx", TiledMap.class);
return assetManager.get("maps/map_"+level+".tmx");
}
My folderstructure