iOS orientation problem

Discussion about using Moai SDK - post questions, bugs and issues here.

Moderators: seebs, franciscotufro

iOS orientation problem

Postby NickoftheSouth » Thu Jun 21, 2012 2:05 pm

Hello!

I'm making a MOAI game, for iOS.
Yesterday I was testing it on an ipad, and even though I had set the target deployment to portrait only if you turned it it changed to landscape and squished everything!

My colleague seems to think that previous builds did not do this, and it probably pays to note I updated to the 1.2 host this week.

Is there anywhere else in the lua or mm that controls the orientation?

Thanks in advance,
Nick
User avatar
NickoftheSouth
 
Posts: 46
Joined: Tue May 08, 2012 1:35 pm

Re: iOS orientation problem

Postby dana » Thu Jun 21, 2012 2:18 pm

Hi Nick, just to double check, to lock to portrait mode you will have to modify the host in hosts\xcode\ios\Classes\MoaiVC.mm. Around line 45 you should find the instructions, but basically you need to make it:

Code: Select all
  1. if (( interfaceOrientation == UIInterfaceOrientationPortrait ) || ( interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown )) {

  2.   return true;

  3. }

  4.  

  5. return false;



However, there is currently a bug when you do this where initially it'll display everything stretched and out of place, but rotating once fixes it. We are working on a fix for that right now, and we plan to get that out in the near future in the next revision.

Also in the next revision, we're going to default the host to lock to portrait as well.
User avatar
dana
Site Admin
 
Posts: 200
Joined: Fri Mar 02, 2012 6:10 pm
Location: Zipline Games

Re: iOS orientation problem

Postby NickoftheSouth » Wed Jun 27, 2012 3:22 pm

cheers, this seems to have fixed the problem, also we updated to teh latest host build, which does this by default :)
User avatar
NickoftheSouth
 
Posts: 46
Joined: Tue May 08, 2012 1:35 pm


Return to Moai SDK

Who is online

Users browsing this forum: No registered users and 1 guest

x