Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: com.badlogic.gdx.utils.GdxRuntimeException: File not found: data\packer\D:\workspace\FeiYanZouBi\FeiYanZouBi-android\assets\data\packer\level packfile (Internal)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:113)
Caused by: com.badlogic.gdx.utils.GdxRuntimeException: File not found: data\packer\D:\workspace\FeiYanZouBi\FeiYanZouBi-android\assets\data\packer\level packfile (Internal)
调试时,我发现问题是由下面的代码引起的:
TileAtlas atlas=new TileAtlas(map,Gdx.files.internal("data/packer"));
当跟踪到TileAtlas.class时,错误代码行是:
FileHandle packfile = getRelativeFileHandle(inputDir, removeExtension(set.imageName) + " packfile");
问题是set.imageName是D:\workspace\FeiYanZouBi\FeiYanZouBi-android\assets\data\packer\level.png
。
我使用Tiled在Win7中创建.tmx文件。