Hi everyone,
I’m making an iPad game using cocos2d-x and have incorporate showing gamecenter leaderboard in my game.
However, strangely, on iPad1 the leaderboard shows fine while on iPad2 the view is shown upside down.
I should say that I’m using an upside-down portrait because of issues of accidently touching the home button using our game.
So I chose the upside down portrait setting in my project’s settings and in RootViewController implemented shouldAutorotate like this:
- (BOOL) shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown);
}
Since I can’t get the view controller from CCDirector directly since it’s in c++, I’m using [EAGLView sharedEGLView] as recommended in another post.
The code I use to run the leaderboard is:
- (void) showLeaderboard
{
*leaderboardVC = init];
GKLeaderboardViewController* leaderboardController = init];
if
{
leaderboardController.category = @“category”;
leaderboardController.timeScope = GKLeaderboardTimeScopeAllTime;
leaderboardController.leaderboardDelegate = self;
addSubview:*leaderboardVC.view];
[_leaderboardVC presentModalViewController: leaderboardController animated: YES];
}
}
Anyone has an idea what is going on here?
Thanks!
Idan