is it possible to have portrait and landscape on the one app?

Hi guys,

I can do a whole app either in portrait or landscape by setting the orientation in the build.settings file.

But my question is I have an app, where I need it to be in portrait for the first few levels.. then in landscape.. then change again..

is thus possible to do?

Thanks

Vik

Yes, you can support portrait as well as landscape in one app - although in this case it could be an issue as you only want some levels portrait and some landscape, you don't want rotation happening every time the device is turned around.

I'd think the safest way to do this would be to support landscapeRight and simply create the portrait levels "sideways" - this way there wouldn't be any accidental turns later and you wouldn't have to reposition anything manually either.

Peach :)

Peach,

Thanks for that..

just a few quick questions...

1. Does that mean the orientation I set in the build settings is set for the whole app? anyway to change that orientation attribute on the fly? (just curious)

2. Also for the rotation to happen, do I need to set anything up on the build.settings file? the last game I made, the rotation didn't work if I rotate the ipad/android device (other apps rotated)

Vik

Hey Vik,

Sorry for the delay - I was off yesterday.

1) Yes, there's no way to change it on the fly at present, or not a built-in way, no. I did once see a third party class that I think may have tried to handle this however I hadn't used it myself. A search of sample code may turn something up.

2) Build.settings should have the default and the supported orientations listed and should then auto rotate - do you have the build.settings available that gave you trouble last time? Could you share them? (I can test.)

Peach :)

views:1299 update:2012/1/3 13:02:13
corona forums © 2003-2011