【代码收集】提前载入贴图
生活随笔
收集整理的这篇文章主要介绍了
【代码收集】提前载入贴图
小编觉得挺不错的,现在分享给大家,帮大家做个参考.
2019独角兽企业重金招聘Python工程师标准>>>
在进入一个比较大的场景的时候,我们一般都会提前load场景的贴图,使游戏更加流畅,一边加载一边显示游戏的加载的进度
具体的方法实现如下:
CCTextureCache::sharedTextureCache()->addImageAsync("war/prison.png", this, callfuncO_selector(War::loadCallBack)); CCTextureCache::sharedTextureCache()->addImageAsync("war/prison2.png", this, callfuncO_selector(War::loadCallBack)); CCTextureCache::sharedTextureCache()->addImageAsync("war/prison3.png", this, callfuncO_selector(War::loadCallBack));void War::loadCallBack(CCObject* obj) { ++num; .....处理进度条 }转载于:https://my.oschina.net/u/248546/blog/209477
总结
以上是生活随笔为你收集整理的【代码收集】提前载入贴图的全部内容,希望文章能够帮你解决所遇到的问题。
- 上一篇: 菜鸟学前端--javascript基础
- 下一篇: http中指定使用worker/pref