game is in portrait mode but gamecenter is in landscape

Hi, I’ve succeed in connecting gamecenter to my game, however, it is always showing in landscape.

My game is in portrait mode, but I don’t know why does this happen?

I’ve changed the RootViewController.mm, shouldAutorotateToInterFaceOrientation function, to make it portrait, did I miss something?

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return UIInterfaceOrientationIsPortrait(interfaceOrientation );
}

This might be a stupid question from me but, do you have supportedInterfaceOrientations and shouldAutorotate methods as follows?

// For ios6, use supportedInterfaceOrientations & shouldAutorotate instead
- (NSUInteger) supportedInterfaceOrientations{
#ifdef __IPHONE_6_0
    return UIInterfaceOrientationMaskAllButUpsideDown;
#endif
}

- (BOOL) shouldAutorotate {
    return YES;
}

And did you set landscape to the ‘Device orientation’ to Landscape in the project target settings? :slight_smile:

Davide Jones

@davidejones88

Thank you, Silly me…I set landscape in target settings…:stuck_out_tongue:

thank you very much.