Created
April 10, 2013 22:54
-
-
Save dunvi/5359174 to your computer and use it in GitHub Desktop.
from the commit message: Added a popSceneWithTransition function. Its use is as follows: [[CCDirector sharedDirector] popSceneWithTransition:[<transition type here> class] duration:<float value here>]; code snippets from <www.cocos2d-iphone.org/forum/topic/1076>.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void) popSceneWithTransition: (Class)c duration:(ccTime)t; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void) popSceneWithTransition: (Class)transitionClass duration:(ccTime)t | |
{ | |
NSAssert( runningScene_ != nil, @"A running Scene is needed"); | |
[scenesStack_ removeLastObject]; | |
NSUInteger c = [scenesStack_ count]; | |
if ( c == 0 ) | |
[self end]; | |
else { | |
CCScene* scene = [transitionClass transitionWithDuration:t scene:[scenesStack_ objectAtIndex:c-1]]; | |
[scenesStack_ replaceObjectAtIndex:c-1 withObject:scene]; | |
nextScene_ = scene; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment