Krishna Raj Salim
Krishna Raj Salim

Reputation: 7390

How to set individual device orientation for individual pages : Corona- SDK

I've made a game using Corona-SDK. It has 2 scenes: (1) Menu scene and (2) Game scene. I need my app to be supported with two orientations : 'landscapeRight' and 'landscapeLeft'. For that, I used the following lines of code in build.settings :

 orientation =
 {
    default = "landscapeRight",
    supported =
    {
        "landscapeRight", "landscapeLeft"
    },
 }

Unfortunately, this will affect the whole app.

But I want my game scene to be supported with only one orientation(eg: landscapeRight or landscapeLeft or in portrait).

Upvotes: 2

Views: 1778

Answers (1)

speeder
speeder

Reputation: 6296

Sorry, but Corona SDK does not have such capability.

What you can do is lock into one orientation, and places where you want to support more than one orientation, you can manually check the accelerometer to see if the phone is upside down, and then manually flip your graphics.

The most easy way to flip the graphics is put them all in a single group centered on the screen, and rotate that group 180 degrees.

Upvotes: 3

Related Questions