1
我試圖加載一個場景。這在第一次運行良好,但是當我嘗試重新加載時,會出現放置動畫的白色方塊。cocos2d啓動/停止運行場景
這是啓動和停止場景的代碼。我錯過了什麼?
感謝。
-(void)runScene:(OTAnimationCC2d *)animation
{
scene = [CCScene node];
[scene addChild:animation];
if ([[[CCDirector sharedDirector] runningScene] isRunning])
{
[[CCDirector sharedDirector] replaceScene:scene];
}
else
{
[[CCDirector sharedDirector] runWithScene:scene];
}
}
-(void)stopScene
{
[[[CCDirector sharedDirector] runningScene] stopAllActions];
[[[CCDirector sharedDirector] runningScene] removeAllChildrenWithCleanup:YES];
[[CCDirector sharedDirector] pushScene:scene];
}
需要更多信息...如何調用這些方法,以及爲什麼在stopScene結束時將場景推回自己。 – 2012-02-23 19:21:29