ios - Orientation problem while using GKLeaderboardViewController -
unfortunately, don't understand uiviewcontrollers well, nor understand how mesh cocos2d scenes. however, able load standard game center leaderboard view on top of cocos2d (landscape-only) game on iphone. but, game universal app , when try on ipad, game center view loads in portrait orientation, half size should (fills 1 quarter of screen), , not centered. when rotate device, game center view orients landscape gets stretched out , looks wasn't designed ipad in landscape view.
does have advice?
- (void) showleaderboard { if(![myappdelegate isgamecenterapiavailable]) return; if ([gklocalplayer localplayer].isauthenticated == yes) { cgsize screensize = [[uiscreen mainscreen] bounds].size; tempvc = [[rootviewcontroller alloc] init]; gkleaderboardviewcontroller *leaderboard = [[[gkleaderboardviewcontroller alloc] init] autorelease]; if (leaderboard != null) { leaderboard.leaderboarddelegate = self; [[[ccdirector shareddirector] openglview] addsubview:tempvc.view]; // pause game [[ccdirector shareddirector] pause]; [tempvc presentmodalviewcontroller:leaderboard animated: no]; leaderboard.view.transform = cgaffinetransformmakerotation(cc_degrees_to_radians(0.0f)); [leaderboard.view setcenter:cgpointmake(screensize.height/2, screensize.width/2)]; leaderboard.modalpresentationstyle = uimodalpresentationcurrentcontext; } } } - (void)leaderboardviewcontrollerdidfinish:(gkleaderboardviewcontroller *)viewcontroller { [tempvc dismissmodalviewcontrolleranimated: yes]; [tempvc.view.superview removefromsuperview]; [tempvc release]; tempvc = nil; // resume game [[ccdirector shareddirector] resume]; }
please take @ implementing iads in cocos2d application.
[self.view addsubview:self.bannerview];
in tutorial, addsubview uiview object rootviewcontroller.view, in cocos2d application template, instead of eaglview.
Comments
Post a Comment