我在基于 LibGdx 的游戏中使用 TextureAtlas.随着 Atlas 大小的增加,加载时间也会增加,因此在显示我在游戏中设置的动画时会出现延迟.
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.
因此,我希望获得我的 TextureAtlas 加载过程的状态.1.无论如何要获得状态?2. 有听众吗?
Hence I wish to get the status of the loading process of my TextureAtlas. 1. Anyway to get the status ? 2. Any Listener ?
可以举个例子,用这个方法加载的asset,yourAssetManage.getLoadedAssets()这个方法返回一个int 表示加载资产的数量
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-
or isLoaded(String fileName); http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/assets/AssetManager.html#isLoaded-java.lang.String-
yourAssetManage.isLoaded("fileNameOfYourAsset");
这篇关于加载 TextureAtlas 的状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
如何创建漩涡/漩涡效果?How to create whirlpool/vortex effect?(如何创建漩涡/漩涡效果?)
Android/Java - GoogleMaps FragmentActivity 上的自定义视图Android/Java - Custom View on GoogleMaps FragmentActivity isnt shown(Android/Java - GoogleMaps FragmentActivity 上的自定义视图未显示)
LibGdx 2 半屏“按钮"LibGdx 2 half screen quot;buttonsquot;(LibGdx 2 半屏“按钮)
libgdx 剪切图像libgdx Cutting an image(libgdx 剪切图像)
如何在启动 Android LibGDX 项目时修复 NoClassDefFounHow do I fix a NoClassDefFoundError while launching Android LibGDX Project?(如何在启动 Android LibGDX 项目时修复 NoClassDefFoundError?)
如何让玩家通过相机被摧毁?How to make player get destroyed through camera?(如何让玩家通过相机被摧毁?)