Game Development Community

The Upside down bug

by John Vanderbeck · in iTorque 2D · 05/16/2012 (5:33 pm) · 4 replies

Anyone have any ideas on what is causing iT2D to start up upside down if the device isn't in landscape home button right? I have rotation working now, but it always starts up in landscape home button right, regardless of the device orientation at time of startup.

#1
05/16/2012 (5:56 pm)
So digging around a bit, it looks to me like the engine is setting the orientation and whether it is "upside down" or not, based on script variables. Which I guess makes sense if you want to force a certain orientation, but in my case I want both landscape orientations to work, and I want it to startup in whatever one the device is in. Whether that be upside down or right side up.
#2
05/18/2012 (1:05 pm)
Oops -- re-read the original post.

In theory you can poll gyroscope.yaw, gyroscope.pitch and gyroscope.roll to determine the device's orientation before displaying the menu and adjust accordingly. I'm not completely sure - not an Apple guy.
#3
05/18/2012 (1:09 pm)
@Richard
No, it won't. I've tested this a lot because it drives me crazy. With rotation enabled, the game will start up in a set rotation (which is landscape right) and if you have the device upside down, the game will remain upside down until such time as you slightly move the device causing the rotation to readjust.

If you start upside down and don't touch the device, it will never rotate to the proper orientation.
#4
07/26/2012 (12:44 am)
Disable auto rotation code, add the root view controller, then setup the auto rotating for root view controller then everything will work fine.