I am using the TextureAtlas in my LibGdx based game. As the size of the Atlas increases the loading time increases hence there is a delay in showing the animations that I have setup in the game.
Hence I wish to get the status of the loading process of my TextureAtlas. 1. Anyway to get the status ? 2. Any Listener ?
You can take for example, asset that have been loaded with this method, yourAssetManage.getLoadedAssets ()
this method return an int
indicating the number of loaded assets
Gdx.app.log("asset loaded :", ""+yourAssetManger.getLoadedAssets());
if (yourAssetManger.update()) {
if (Gdx.input.isTouched()) {
yourGame.setScreen(new yourScreen());
}
}
or isLoaded(String fileName); http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/assets/AssetManager.html#isLoaded-java.lang.String-
yourAssetManage.isLoaded("fileNameOfYourAsset");
来源:https://stackoverflow.com/questions/30523548/status-of-the-loading-the-textureatlas