Status of the Loading the TextureAtlas(加载 TextureAtlas 的状态)
问题描述
我在基于 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 的状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:加载 TextureAtlas 的状态
基础教程推荐
- Maven:无效的目标版本:10 2022-01-01
- 在java中使用xpath和selenium解析HTML表格数据 2022-01-01
- doFilter()是在servlet的工作完成之前还是之后执行的? 2022-01-01
- 在springboot中如何给mybatis加拦截器 2023-04-29
- 如何在相机中应用自定义滤镜 [Surfaceview 预览]. 2022-01-01
- 将 Windows 证书导入 Java 2022-01-01
- 将 double 转换为 Int,向下舍入 2022-01-01
- 控制台应用程序中的 Java 键盘输入解析 2022-01-01
- Java ECDSAwithSHA256 签名长度不一致 2022-01-01
- JPA惰性列表上的流 2022-01-01
