加载TextureAtlas的状态

时间:2015-05-29 07:22:57

标签: java android libgdx texture-atlas

我在基于LibGdx的游戏中使用TextureAtlas。随着Atlas的大小增加,加载时间增加,因此显示我在游戏中设置的动画有延迟。

因此,我希望获得TextureAtlas加载过程的状态。 1.无论如何要获得状态? 2.任何听众?

1 个答案:

答案 0 :(得分:0)

例如,您可以使用此方法加载的资源,yourAssetManage.getLoadedAssets ()此方法返回int ,表示已加载资源的数量

    Gdx.app.log("asset loaded :", ""+yourAssetManger.getLoadedAssets());

    if (yourAssetManger.update()) {

         if (Gdx.input.isTouched()) { 
            yourGame.setScreen(new yourScreen());
        }
    }

或isLoaded(String fileName); http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/assets/AssetManager.html#isLoaded-java.lang.String-

yourAssetManage.isLoaded("fileNameOfYourAsset");