在進入一個比較大的場景的時候,咱們通常都會提早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; .....處理進度條 }