代码看起来像这样:
if (Gdx.app.getType() == ApplicationType.Android) path = "data/images/";
if (Gdx.app.getType() == ApplicationType.Desktop) path = "./bin/data/images";
(如果我对桌面使用“数据/图像/”,我会崩溃)。
assetmanager.load(path + fileName)
,assetmanager.finishLoading()
后来assetmanager.get(path + fileName)
在 Eclipse 和 Android 上也能完美运行,但是当我创建一个可运行的 .jar 并从控制台启动它时,我得到了Asset not loaded: ./bin/data/images/image.jpg
. 因此,由于某种原因,它无法访问我的 .jar 存档中的数据文件夹。我该如何解决?
谢谢!