Skip to content

Instantly share code, notes, and snippets.

@hlxwell
Last active September 27, 2015 02:58
Show Gist options
  • Save hlxwell/1200869 to your computer and use it in GitHub Desktop.
Save hlxwell/1200869 to your computer and use it in GitHub Desktop.
animation from cocos2d to UIView
-(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