Portrate and Landscape Orientation

Hello!

I’m having a very simple problem that I completely confused about and can’t seem to figure out. It is about the orientation of my app when it launches. 

I want my app to launch in either landscapeRight  or landscapeLeft. 

I know this is done via the build.settings file. However, even though I use the following, the launched screened doesn’t look correct. 

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

The photo isn’t filling the screen properly or it gets stretched. See first image attached.

Now, if I rotate the image to Portrait before exporting out of photoshop/inkscape, the image looks perfect on the launched screen. See third image attached. 

I read somewhere in the tutorials that the Width and Height should be specified for the device in ‘Portrait’ mode, so I have done likewise in my config.lua file. 

Please advise…

The values in config.lua are always specified assuming a portrait orientation, but that’s the only place that rule affects. In your code, if your app is landscape, the width will be a bigger number than the height.

You make your background say 570 wide and 360 tall in your image editing software. Then when you go to include it in your code:

local background = display.newImageRect( "background.png", 570, 360  )

The config.lua would have a width of 360 and height of 570 since its measuring the device screen in portrait mode.

Rob

Thank you! Problem solved. 

The values in config.lua are always specified assuming a portrait orientation, but that’s the only place that rule affects. In your code, if your app is landscape, the width will be a bigger number than the height.

You make your background say 570 wide and 360 tall in your image editing software. Then when you go to include it in your code:

local background = display.newImageRect( "background.png", 570, 360  )

The config.lua would have a width of 360 and height of 570 since its measuring the device screen in portrait mode.

Rob

Thank you! Problem solved.