LibGDX File not found

无人久伴 提交于 2019-12-12 02:45:49

问题


Im trying to load a tiled map in libGDX with

tileMap = new TmxMapLoader().load("maps/level1.tmx");

but somehow it returns a File not found exception:

Caused by: com.badlogic.gdx.utils.GdxRuntimeException: File not found: maps\level1.tmx (Internal)
at com.badlogic.gdx.files.FileHandle.read(FileHandle.java:136)
at com.badlogic.gdx.files.FileHandle.reader(FileHandle.java:164)
at com.badlogic.gdx.utils.XmlReader.parse(XmlReader.java:81)
... 9 more

I already tried to change the path to "/maps/level1.tmx" and other things but nothing works. It returns the file not found exception every time. Can someone see the error?

The path to the .tmx file is:

assets/maps/level1.tmx

the orginal assets folder is in the android project and in every project, the assets folder is linked..

来源:https://stackoverflow.com/questions/24123681/libgdx-file-not-found

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!