The AssetManager is a class that helps you manage your assets.
First off, you need to create an instance:
AssetManager am = new AssetManager();
After this is initialized, and before you render anything, you want to get the resources:
am.load("badlogic.jpg", Texture.class);//Texture.class is the class this asset is of. If it is a //sound asset, it doesn't go under Texture. if it is a 3D model, it doesn't go under Texture.class //Which class added depends on the asset you load //... other loading here ...// //when finished, call finishLoading: am.finishLoading();
Now, whereever you feel like getting
Texture texture = am.get("badlogic.jpg"); //Ready to render! The rendering itself is in the normal way
Using AssetManager allows you to load them once into the memory of the AssetManager, and then get them as many times as you want.
Why use AssetManager? (from the wiki):
AssetManager (code) helps you load and manage your assets. It is the recommended way to load your assets, due to the following nice behaviors: