在进入一个比较大的场景的时候,咱们通常都会提早load场景的贴图,使游戏更加流畅,一边加载一边显示游戏的加载的进度this
具体的方法实现以下:spa
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; .....处理进度条 }