I already have my game detecting iPad orientation and rotating properly. And I have the Unity splash screen orienting to proper rotation on app startup.
But I can’t figure out how to force the OpenFeint login screen to rotate to the current orientation on app startup. It always opens according to the “Initial Dashboard Orientation” that’s set in OpenFeint settings. This means if I have the iPad in the opposite orientation (upside down) when I launch the game, the OF Login screen will be displayed upside down. This is the screen that comes up immediately before/as the game starts – apparently the login dashboard is called before any game scripts are executed so I can’t even get it to check SetDashboardOrientation() before it launches.
before launching the Dashboard from menus inside the game so that the dashboard at least gets the proper orientation. But when the OF window is up, it doesn’t rotate with the iPad.
Any thoughts on how to handle either of the above issues?
I ended up working around this issue in AppController+OpenFeint.mm by keeping track of the UIDevice orientation property and when it differs/changes from the last time I checked it, I close the OF dashboard altogether. This doesn’t rotate the dashboard, but it will at least close it when it’s open and the orientation changes, and Apple did approve my iPad game which employed this workaround.
For example, here’s the code for an app that uses Portrait and PortraitUpsideDown (change as needed for Landscape variants):
As for launching the dashboard in the correct orientation to begin with, I also used code similar to that which you referenced, but I specifically set the orientation in it.
For example, I have the following attached to my main Camera in one of my scenes:
Add in the required Info.plist changes to launch in the correct orientations and the iPhoneKeyboard.autorotate* properties to prevent the outer app frame from rotating, and Apple approved the resulting behavior in my OF-enabled iPad game so although this is a workaround maybe it will also work for you.
Thanks, Sean! That’s just the information I needed. Everything is working better now, tho it would be nice if there were a way to rotate OF rather than just closing it. Hopefully the OF guys will figure this out.
When the application launches the splash screen looks fine, the initial game screen looks fine, but when the OF “Welcome Back” notification pops up it is upside down and comes from the bottom (instead of the top as it should). If I click the OpenFeint button to launch the dashboard the dashboard launches fine but the OS Status bar is shown upside down on the bottom of the screen. If I close the OF dashboard and then re-launch it everything looks fine. Any suggestions?
I use the following code to make my screen flip when the device is rotated and it should also make sure that the OpenFeint Dashboard and Achievement prompts are oriented properly when they display:
function FixedUpdate() {
if ((iPhoneInput.orientation == iPhoneOrientation.LandscapeLeft) (iPhoneSettings.screenOrientation != iPhoneScreenOrientation.LandscapeLeft)){
iPhoneSettings.screenOrientation = iPhoneScreenOrientation.LandscapeLeft;
OpenFeint.SetDashboardOrientation(iPhoneOrientation.LandscapeLeft);
}
if ((iPhoneInput.orientation == iPhoneOrientation.LandscapeRight) (iPhoneSettings.screenOrientation != iPhoneScreenOrientation.LandscapeRight)){
iPhoneSettings.screenOrientation = iPhoneScreenOrientation.LandscapeRight;
OpenFeint.SetDashboardOrientation(iPhoneOrientation.LandscapeRight);
}
}
I’ve got it all working correctly thanks to you guys! - Except the OpenFeint.
In LandscapeRight the OpenFeint “welcome back” and “dashboard” are displayed upside down?
Any help would be greatly apprieciated…Thanks