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

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-02 03:20:36

问题


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).


回答1:


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.



来源:https://stackoverflow.com/questions/14411137/how-to-set-individual-device-orientation-for-individual-pages-corona-sdk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!