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;
.....处理进度条
}