我见过很多这两种情况的例子,例如:
atlas = new TextureAtlas("skins/userInterface.pack");
white = new BitmapFont(Gdx.files.internal("font/white.fnt"));
我在教程中看到过,但它也是这样工作的:
atlas = new TextureAtlas(Gdx.files.internal("skins/userInterface.pack"));
white = new BitmapFont("font/white.fnt");
什么时候应该使用 Gdx.files.internal 或直接使用 Assets 文件夹的相对路径?
最佳答案
完全一样。当使用 String
参数时,构造函数使用 Gdx.files.internal
来解析文件,就像您自己做的那样。
可以看到这个here例如在 TextureAtlas
的情况下。
关于android - 何时使用 gdx.files.internal 以及何时使用相对路径?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32156415/