Fixed Landscape Orientation

Hi there, so far i’ve built my game into a “portrait” orientation and I really want the game to be only playable in “landscape” orientation. I have done my research a little bit and it seems the way to do that is to change the build.settings?

settings = { orientation = { default = "landscapeRight", supported = { "landscapeLeft", "landscapeRight", "portrait", "portraitUpsideDown", }, }, }

i have replace the code in build.settings with this one…but when i use corona simulator nothing changed… The game would still start with portrait orientation and when I rotate it 90 degree the game wouldn’t convert automatically to landscape orientation.

how do i convert my game to landscape orientation? I have to do it manually? (placing objects in corona simulator when i already rotate it 90 degree?). considering that i have built the game in portrait orientation, i have to replace all the objects one by one? [import]uid: 114765 topic_id: 21610 reply_id: 321610[/import]

[lua]settings =
{
orientation =
{
default = “landscapeRight”,
supported =
{
“landscapeLeft”, “landscapeRight”,
},
},
}[/lua]

That should force landscape only :slight_smile:

Peach [import]uid: 52491 topic_id: 21610 reply_id: 85752[/import]

hi ok but why when i try to see it in corona simulator the game can be still played in portrait orientation?

and why the game doesn’t automatically convert to landscape? I built the game (previously) on portrait orientation, now if i rotate 90 degree in corona simulator, the objects wouldn’t rotate to follow the landscape orientation. does it mean i have to replace the whole images again? [import]uid: 114765 topic_id: 21610 reply_id: 85767[/import]

If you mean that you coded a game in portrait then yes, you need to reposition things for landscape.

This is because in portrait mode an object could have a y of 400, which would appear off the screen in landscape.

You may want to check out some of the sample code, we have some focusing on orientation changes in CoronaSDK > SampleCode > Interface

Peach :slight_smile: [import]uid: 52491 topic_id: 21610 reply_id: 86026[/import]