0

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 ?

iappmaker
  • 2,945
  • 9
  • 35
  • 76

1 Answers1

0

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");
Angel Angel
  • 19,670
  • 29
  • 79
  • 105