开发者

How to show modal in cocos2d game application?

开发者 https://www.devze.com 2023-03-06 16:27 出处:网络
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.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消