Disable Autorotation for GameCenter

Forums Programming Programming – Everything else Disable Autorotation for GameCenter

This topic contains 4 replies, has 4 voices, and was last updated by  MandarX 2 years ago.

Viewing 5 posts - 1 through 5 (of 5 total)
Author Posts
Author Posts
February 8, 2012 at 6:58 am #238997

rickylai
@rickylai

I’m trying to implement the Game Center Achievements in my first game. The orientation of my game is landscape left only.

What I have done so far is to change GameConfig.h as below:

#if defined(__ARM_NEON__) || TARGET_IPHONE_SIMULATOR
#define GAME_AUTOROTATION kGameAutorotationNone

#elif __arm__
#define GAME_AUTOROTATION kGameAutorotationNone

My game is then fixed in the Landscape Left orientation at all times. However, when I enter the Game Center Achievement screen from my game, the autorotation is still happening. I am a bit confused with the concept here. Could you guys please tell me why this is happening? And How can I fix this? Do I need to change anything from RootViewController?

Thanks very much in advance. I would really appreciate for your help.

March 19, 2012 at 9:27 pm #364624

eidosk
Participant
@eidosk

hi guys,

same problem here. Is there a way do disable autorotation inside the game center?

March 20, 2012 at 1:47 am #364625

JHNeves
Participant
@jhneves

I am not sure if this will work but you can try:

[[UIDevice currentDevice] endGeneratingDeviceOrientationNotifications];

March 20, 2012 at 8:40 am #364626

rickylai
@rickylai

@JHNeves

It works!!! :)

Thank you.

and thanks eidosk for bringing this thread back up!

March 20, 2012 at 6:10 pm #364627

MandarX
Participant
@mandarx

Hello

how to let the device regenerate notifications once you are done?

MandarX

edit: found! beginGeneratingDeviceOrientationNotifications

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.