system.setOrientation(...)

Are there plans to expose the set orientation functionality of iOS and Android?

iOS:
[[UIDevice currentDevice] setOrientation:UIInterfaceOrientationLandscapeLeft];

Android:
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);

I know that you can set the default/start orientation in the build.settings file, but withing an app I am designing I want the ability to have certain portions display in landscape and others in portrait.

Is there a way to currently do this that I am just not seeing? It seems like my only option is to force the orientation to potrait and for the portions that need to be landscape rotate all of the on screen elements 90 degrees and swap all x and y values (or vice versa - force landscape and then switch for portrait). [import]uid: 47373 topic_id: 9250 reply_id: 309250[/import]

Hey there,

This could be what you’re looking for;
http://www.burtonsmediagroup.com/blog/2010/07/developing-iphoneipadandroid-applications-with-corona-orientation-change/

See what you think :slight_smile:

Peach [import]uid: 52491 topic_id: 9250 reply_id: 34032[/import]

Correct me if I am wrong, but that link merely explains how to handle the event of an orientation change.

What I sent to be able to do is call something like…

System.setOrientation(“portrait”)

or

System.setOrientation(“landscapeleft”)

so that the x,y coordinates will have their 0,0 location be at the expected location. [import]uid: 47373 topic_id: 9250 reply_id: 34034[/import]

Well you could modify that code to use it when you wanted the orientation to change and not simply when the user rotated their device.

However I do understand what you’re suggesting/requesting and I will bring it up in our next meeting.

Peach :slight_smile: [import]uid: 52491 topic_id: 9250 reply_id: 34042[/import]

Thanks :slight_smile: [import]uid: 47373 topic_id: 9250 reply_id: 34046[/import]

Hi all,

Has there been any progress on this issue.
I too would like to be able to force a particular scene into portrait mode.

Assigning “system.orientation” doesn’t seem to work

I am writing a game in landscape mode.
The game includes a shared settings page that we use in all of our games (most of them are in portrait)
Therefore, the settings page is currently optimized for portrait
The shared settings page includes many text-fields.

The scene that I have uses native text-field controls and I need the keyboard to also be forced to be rotated into portrait

Thanks [import]uid: 67377 topic_id: 9250 reply_id: 51892[/import]

Hi,

Any news about this subject?

Thanks [import]uid: 102357 topic_id: 9250 reply_id: 78746[/import]

Hi,

Why a “native.showWebPopup” does not create an element in the display root group?

I have a Text message in the screen and a webpopup.

if i run this code:

local count = display.getCurrentStage().numChildren  
print( "Number of objects on the screen = " .. count )  

and the total count is “1”, therefore i cannot use the method that you mentioned above to change the orientation of a webPopup.

To do this i have 2 alternatives:

  • have the functionality that mrzorn mentioned
  • You make a showWebpopup like an object in the stage

But, neither of this alternatives are available.

I’ve very urgency on this matter. Can you please answer asap?

Thanks [import]uid: 102357 topic_id: 9250 reply_id: 78791[/import]