Game Development Community

iT2D 1.5.1 Preview - Device orientation bugs

by Conor O'Kane · in iTorque 2D · 06/30/2012 (8:07 pm) · 18 replies

There are a couple of orientation bugs in 1.5.1 preview which I think are related so I'm listing them together here.

Device: iPad 1 iOS 5.1

Start an app in landscape left mode. The game will appear upside-down however iOS elements such as the Volume indication and Game Center sign-in notification are orientated correctly.

If you are very careful to not rotate the device, and call up the Game Center leaderboard with showLeaderboard(), it will appear correctly. However as soon as you tilt the device, the Torque game orients itself correctly but the Game Center leaderboard window rotates off-screen. The game is now frozen in this state waiting for the user to press the 'done' button on the leaderboard window, which is off screen. If you rotate the device again you can briefly see the leaderboard window rotate through the view before it goes off screen again.

If you initially orient the device in landscape right orientation and call up the leaderboard, it will display correctly at first, however now if you rotate the device 180 degrees the game will reorient correctly but the Game Center leaderboard window will be upside-down.

To test this you'll need game center enabled for your app on iTunes Connect.
Apple will reject apps with this behavior.

[edit] Just tested this with Achievements and the Game Center Achievements window has the same display problems.

#1
07/01/2012 (11:32 am)
I noticed very similar behavior in the simulator but I figured it was probably something I did wrong.
#2
07/01/2012 (7:18 pm)
Joe, indeed it may just be a configuration issue. I created a new project in 1.5.1 specifically to test game center so there would be no legacy script from older projects. However I may have gotten the Xcode settings wrong. It would be good to get a guide to the correct Xcode settings if this is just a configuration issue and not a view controller problem.
#3
07/04/2012 (9:16 pm)
Any chance that this will get looked at for iT2D 1.5.1 preview 2?
#4
07/06/2012 (6:54 am)
Some more info on this issue:

Setting enableOrientationRotation = 0 in prefs.cs (which is the same as unchecking the enable orientation box in the editor) prevents the Torque game from rotating, however the Game Center windows still rotate.

Also, I tried integrating Paul Jan's implementation of the View Controller using GLKit
www.garagegames.com/community/blogs/view/21550
(Thanks to Paul for walking through this with me on IRC) and it does not suffer from these rotation issues.
#5
07/16/2012 (12:50 am)
So, over two weeks and not a word on this. Is anyone looking at it? This bug is preventing me from submitting my game to Apple.
#6
07/17/2012 (7:40 am)
Hey Conor,

I asked about a month ago for a solution to add a RootViewController to my app. http://www.garagegames.com/community/forums/viewthread/130731

It took some finagling but once everything was properly connected it worked like a champ. I haven't thoroughly tested with an iPad retina though (mostly because I'm not sure what I'm looking for). It works with the games I've tested though.

I recommend you check it out as well. I might be able to help you resolve a few things if you have questions too.
#7
07/17/2012 (10:55 pm)
Hi Joe - I was able to get Paul's system working, however it uses GLKit which is only available in iOS 5 and later, but my publisher wants me to support iOS 4. Also, although the orientation issues were solved by this, it didn't display correctly on the iPad 3 - my game uses 2 scenegraphs and one of them continued to display at 1024x768, and not the full 2048x1536 resolution.
#8
07/18/2012 (7:08 am)
To expand the screen size for my 2nd scenegraph I had to add a bit in game.cs in setResolution() to do:

function setResolution() {
..
      else
      {
         if(($pref::iOS::DeviceType != $iOS::constant::iPad))
         {
            echo(" % - MainScreen set to Landscape! 480x320 ");
            mainScreenGui.Extent = "480 320";
            sceneWindow2D.Extent = "480 320";
            // fix up my 2nd scenegraph
	    backgroundWindow2D.Extent = "480 320";
         }
         else
         {
            echo(" % - MainScreen set to Landscape! 1024x768 ");
            mainScreenGui.Extent = "1024 768";
            sceneWindow2D.Extent = "1024 768";
	    backgroundWindow2D.Extent = "1024 768";
         }
      }
   }
}
#9
07/18/2012 (7:12 am)
Thanks for the tip Joe - I'll give that a try!
#10
07/19/2012 (12:21 am)
Joe - it works! Thanks very much for the help, and thanks to Paul for the resource.


Solution for anyone else with this issue

- Don't upgrade to 1.5.1 preview.
- Add Paul Jan's Root View Controller resource to iT2D 1.5 www.garagegames.com/community/blogs/view/21550
- Add 'YourNewSceneWindowName.Extent' values (as shown in Joe's post above) to SetResolution() in game.cs if you have a second scenegraph for a static GUI or HUD.
#11
07/20/2012 (7:30 am)
Yay! Glad to hear it works :)

I am curious though - does this address your issue with the border lines on your images or is that still broken?
#12
07/22/2012 (5:27 am)
Joe - no that bug still exists, however it's not so serious that Apple would reject the app so I can still submit it for final QA and possibly patch it before release.
#13
09/07/2012 (1:11 pm)
so 1.4.1 is the right one?

thanks for this
#14
09/08/2012 (12:45 am)
Isaac - Paul's fix is designed for iT2D 1.5
#15
09/11/2012 (6:45 am)
Conor, does your solution in pos #10 (with Paul Jan's thing and Joe O's help) work with iOS 4, or just 5?
#16
09/11/2012 (7:58 am)
Joe - no, Paul Jan's root view controller fix uses GLKit which is for iOS 5.0 and later only.
#17
09/11/2012 (5:46 pm)
Thanks Conor. I didn't know if maybe something had changed with that or not. Did you ever find a iOS 4 fix?
#18
09/11/2012 (7:54 pm)
Joe - iT2D 1.5.1 preview was supposed to support iPad 3 and correct orientations for iOS 4 and even 3 I suspect. However work has stopped on it, GarageGames have abandoned the current line of iT2D and are prioritizing their new combined T2D/iT2D engine. So your options now are either implement the fix above for iOS 5, or wait.