I want to know how to show modal view in coco开发者_如何学JAVAs2d? Any one can help me?
Thanks before. Regards. :)
I use this code for presenting a GKLeaderboard within cocos2d.
GKLeaderboardViewController *leaderboardController = [[GKLeaderboardViewController alloc] init];
UIViewController *container = [[UIViewController alloc] init];
[container setView:[[CCDirector sharedDirector] openGLView]];
[container setModalTransitionStyle: UIModalTransitionStyleCoverVertical];
leaderboardController.leaderboardDelegate = container;
[container presentModalViewController: leaderboardController animated: YES];
This will do what you want. Don't forget you need to release the UI objects when your done with them.
精彩评论