iOS landscape support broken

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

Moderators: naturally, seebs, ezraanderson

iOS landscape support broken

Postby Jay » Tue Jul 03, 2012 1:22 pm

When I try to run my landscape project on iOS, the graphics display incorrectly. Everything appears to be squished into a portrait orientation, or something to that effect. It is probably the same problem as posted here.

I followed these directions on the wiki to setup landscape: http://getmoai.com/wiki/index.php?title ... OS_Devices

And here is my relevant lua code:
Code: Select all
  1. local viewport = MOAIViewport.new ()

  2. viewport:setSize ( 960, 640 )

  3. viewport:setScale ( 480, 320 )


The problem described above occurs on both the simulator and the actual device, and with both 1.2 and the nightly build.
Jay
 
Posts: 14
Joined: Sun Jun 17, 2012 8:20 pm

Re: iOS landscape support broken

Postby sgeos » Wed Jul 04, 2012 5:34 am

I am pretty sure the iOS landscape has been broken. If I recall correctly, it should be fixed in the next version of the SDK (not the nightly build).
Any original code posted by me is released via the CC0 Public Domain Dedication. It is in the public domain. Do whatever you want with it.
User avatar
sgeos
 
Posts: 241
Joined: Sat Apr 28, 2012 4:42 am
Location: Married in Japan.

Re: iOS landscape support broken

Postby ibisum » Wed Jul 04, 2012 5:43 am

Just to be clear - its not 'broken', but instead more that the MOAI devs expect you to set up the host as you need it - and since everyone has different needs, the hosts as shipped are configured probably in a way that you won't expect. You just have to set up the didRespondToDeviceOrientation: (or whatever it is) method and return the desired result. For some of us, that means we'll stick to Portrait - for others, Landscape - and for yet others, the ability to respond to orientation events in either mode is necessary. I believe that, instead of adding an API to handle this from within MOAI, zipline made the decision to leave the orientation changes up to us developers, for whatever case we need. Whats not clear, is how to address all of this .. but it was responded to fairly well in a thread elsewhere in this forum.
;
--
Email: ibisum@gmail.com
IRC: torpor on FreeNode, see you in the #moai channel
Got a MOAI snippet? Please consider adding it to http://moaisnippets.info/
User avatar
ibisum
 
Posts: 1503
Joined: Mon Oct 17, 2011 1:11 am
Location: Vienna, Austria

Re: iOS landscape support broken

Postby Jay » Wed Jul 04, 2012 2:37 pm

Yeah, I did set up the shouldAutorotateToInterfaceOrientation: method as instructed in the wiki, but something else isn't working properly. Do you know which method it is that's broken that will be fixed in the next version of the SDK?
Jay
 
Posts: 14
Joined: Sun Jun 17, 2012 8:20 pm

Re: iOS landscape support broken

Postby sgeos » Wed Jul 04, 2012 5:56 pm

I configured landscape in Moai SDK 1.0, but the graphics seem to scale improperly in the version of the nightly build I am using. There seems to a problem with rotating the device. I think this is due to locking. There may also be a problem with the iPad 3. If I knew where the problem was I would fix it.
Any original code posted by me is released via the CC0 Public Domain Dedication. It is in the public domain. Do whatever you want with it.
User avatar
sgeos
 
Posts: 241
Joined: Sat Apr 28, 2012 4:42 am
Location: Married in Japan.

Re: iOS landscape support broken

Postby nobeerleft » Wed Jul 04, 2012 6:16 pm

Landscape and rotation has been broken in iOS since 1.1.

I just disable any rotation in my apps as a workaround.
nobeerleft
 
Posts: 36
Joined: Fri Mar 30, 2012 9:35 pm

Re: iOS landscape support broken

Postby dana » Fri Jul 06, 2012 11:19 am

There is another user that is having issues with landscape (forum post here) that I'm not sure if we've completely been able to track it down yet. If it's not working in the latest build, then the chances are high that it may not be fixed yet, so if you can help provide any more information/code that would help us repro this it would be greatly appreciated. Although, there is currently one bug in our queue that is related to the landscape orientation being distorted, so it very well may be that one. We should have that fixed by the next release.
User avatar
dana
Site Admin
 
Posts: 200
Joined: Fri Mar 02, 2012 6:10 pm
Location: Zipline Games

Re: iOS landscape support broken

Postby Jay » Fri Jul 06, 2012 1:47 pm

Alright, I got it working.

First, I added the key "Initial interface orientation" to the Info.plist file, and set the value to a landscape one. That caused everything to work on launch, but when I rotated to the other landscape orientation, the graphics got messed up again.

So to fix the rotation problem, I commented out the contents of the updateOrientation: method in MoaiVC.mm. Now rotation works fine too, so I think I'm all set for now. However, if I need to support both landscape and portrait orientations in the future, the updateOrientation: method might need to be fixed, not just commented out.

Dana, should these two fixes be added to the landscape wiki page?
Jay
 
Posts: 14
Joined: Sun Jun 17, 2012 8:20 pm

Re: iOS landscape support broken

Postby dana » Fri Jul 06, 2012 2:05 pm

Thanks for posting that. I'll update our bug report with that info, and when we have everything working as it's supposed to I'll make sure that the wiki page is up-to-date.
User avatar
dana
Site Admin
 
Posts: 200
Joined: Fri Mar 02, 2012 6:10 pm
Location: Zipline Games

Re: iOS landscape support broken

Postby paolocampitelli » Thu Jul 26, 2012 8:41 am

Jay wrote:Alright, I got it working.

First, I added the key "Initial interface orientation" to the Info.plist file, and set the value to a landscape one. That caused everything to work on launch, but when I rotated to the other landscape orientation, the graphics got messed up again.

So to fix the rotation problem, I commented out the contents of the updateOrientation: method in MoaiVC.mm. Now rotation works fine too, so I think I'm all set for now. However, if I need to support both landscape and portrait orientations in the future, the updateOrientation: method might need to be fixed, not just commented out.

Dana, should these two fixes be added to the landscape wiki page?



same here, works this workaround! Thanks!
paolocampitelli
 
Posts: 5
Joined: Mon Jul 09, 2012 7:17 am


Return to Moai SDK

Who is online

Users browsing this forum: No registered users and 0 guests

cron

x