0
我在我的基於LibGdx的遊戲中使用了TextureAtlas。隨着Atlas尺寸的增加,加載時間也隨之增加,因此在顯示我在遊戲中設置的動畫方面存在延遲。加載紋理的狀態Alaslas
因此,我希望獲得我的TextureAtlas加載過程的狀態。 1.無論如何獲得狀態? 2.任何聽衆?
我在我的基於LibGdx的遊戲中使用了TextureAtlas。隨着Atlas尺寸的增加,加載時間也隨之增加,因此在顯示我在遊戲中設置的動畫方面存在延遲。加載紋理的狀態Alaslas
因此,我希望獲得我的TextureAtlas加載過程的狀態。 1.無論如何獲得狀態? 2.任何聽衆?
可以採取例如已裝載有這種方法,資產,yourAssetManage.getLoadedAssets()
此方法返回一個int
指示加載的資產
Gdx.app.log("asset loaded :", ""+yourAssetManger.getLoadedAssets());
if (yourAssetManger.update()) {
if (Gdx.input.isTouched()) {
yourGame.setScreen(new yourScreen());
}
}
或isLoaded(字符串文件名)的數量; http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/assets/AssetManager.html#isLoaded-java.lang.String-
yourAssetManage.isLoaded("fileNameOfYourAsset");