Last active
September 27, 2015 02:58
-
-
Save hlxwell/1200869 to your computer and use it in GitHub Desktop.
animation from cocos2d to UIView
This file contains hidden or 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)openHighScoreView { | |
GameOverView *tempView = [[HighScoreView alloc] init]; | |
selfish = tempView; | |
[tempView release]; | |
[[CCDirector sharedDirector]replaceScene:[MainScene node]]; | |
[UIView beginAnimations:nil context:NULL]; | |
[UIView setAnimationDuration:.5]; | |
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:[[CCDirector sharedDirector] openGLView] cache:YES]; | |
[[[CCDirector sharedDirector] openGLView] addSubview:go.view]; | |
[UIView commitAnimations]; | |
} | |
-(void)closeHighScoreViewAndStartNewGame { | |
[UIView beginAnimations:nil context:NULL]; | |
[UIView setAnimationDuration:.5]; | |
[UIView setAnimationDelegate:self]; | |
[UIView setAnimationDidStopSelector:@selector(animDone:finished:context:)]; | |
[UIView setAnimationTransition:UIViewAnimationTransitionCurlDown forView:[[CCDirector sharedDirector] openGLView] cache:YES]; | |
[hs.view removeFromSuperview]; | |
[UIView commitAnimations]; | |
[hs release]; | |
hs = nil; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment