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 的状态
基础教程推荐
- RabbitMQ:消息保持“未确认"; 2022-01-01
- 问题http://apache.org/xml/features/xinclude测试日志4j 2 2022-01-01
- Struts2 URL 无法访问 2022-01-01
- REST Web 服务返回 415 - 不支持的媒体类型 2022-01-01
- 使用堆栈算法进行括号/括号匹配 2022-01-01
- 如何对 Java Hashmap 中的值求和 2022-01-01
- Spring AOP错误无法懒惰地为此建议构建thisJoinPoin 2022-09-13
- 无法复制:“比较方法违反了它的一般约定!" 2022-01-01
- 修改 void 函数的输入参数,然后读取 2022-01-01
- 存储 20 位数字的数据类型 2022-01-01
