After my previous gist about handling textures in a libGDX game, I am going to combine the libGDX AssetManager with my approach to see if we can get the best of both worlds.
LibGDX has an AssetManager included, in which you can put all your assets, and it will load them for you. After that, you can retrieve them for actually using them. Disposing the asset manager will dispose all textures inside it nicely.
Positives of using an asset manager:
- Synchronous and Asynchronous asset loading.
- All assets in one asset manager (fonts, textures, skins, sound files etc).
- Support for unloading when pausing and resuming your game.
- Can be extended and since LibGDX is opensource you can alter it.