Java LibGdx TmxMapLoader加载外部文件

Java LibGdx TmxMapLoader加载外部文件,java,android,libgdx,Java,Android,Libgdx,我试图从SD卡加载平铺贴图。 在TmxMapLoader.java中说 * Loads the {@link TiledMap} from the given file. The file is resolved via the {@link FileHandleResolver} set in the * constructor of this class. By default it will resolve to an internal file. 那么,如何将默认值更改为外部值 谢

我试图从SD卡加载平铺贴图。 在TmxMapLoader.java中说

 * Loads the {@link TiledMap} from the given file. The file is resolved via the {@link FileHandleResolver} set in the
 * constructor of this class. By default it will resolve to an internal file.
那么,如何将默认值更改为外部值


谢谢

您可以在构造函数中提供自定义FileHandlerResolver:

TiledMap map = new TmxMapLoader(new ExternalFileHandleResolver()).load("level1.tmx");
有关FileHandleResolver的详细信息: