Search code examples
javaandroidlibgdxloading

Loading external resources


I'm loading all of my resources in a Loading Screen with the LibGDX AssetManager.

The problem I'm having is that the AssetManager only manages internal resources, and most of my resources are external (pictures stored the user's phone), so I have to load them aside (just like that : texture = new Texture(Gdx.files.absolute(filePath)) ), and therefore they are not included in the AssetManager.getProgess().

Is it possible to load external resources with the AssetManager ? Or is there a way to keep an eye on the progression of external resources loading ?


Solution

  • From the docs...

    You can set the FileHandleResolver to be used via the second constructor of AssetManager:

    AssetManager manager = new AssetManager(new ExternalFileHandleResolver());
    

    This will make sure all default loaders listed above will use that loader.