Screen resolution problems

I dont really know why but when I set this in the config

application = { content = { width = 960, height = 540, }, }

it seems to be switched, I want a landscape screen but it looks like a portrait. I can simply just flip the values…

Example of how it looks

cejGWOt.png?1

My main.lua is basically just this

display.setDefault( "background", 150/255,255/255,255/255 ) local w, h = display.contentWidth, display.contentHeight local testrect = display.newRect(w/2,h/2,w,h) testrect:setFillColor( 0,0,0,0.5 )

Set the background color to cyan and draw a 50% alpha black rectangle from the origin (x0, y0) to the edge of the “screen” (x540, y960). But why is it inverted? When I set width to 960 in the config but still get 960 as height…?

This is my build.settings

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

Thats all the files, very simple but dont understand whats up with the screen resolution thing. Is it cause I have it at landscape mode?

Hi @kalle.jillheden,

The “width” value in a width/height setup should always be the shorter (smaller value) in Corona, even if you’re designing a landscape app. If you haven’t read the following guide, please do so… especially the section on “Dynamic Scaling”:

http://docs.coronalabs.com/guide/basics/configSettings/index.html

Best regards,

Brent Sorrentino

Cool thank you!

Hi @kalle.jillheden,

The “width” value in a width/height setup should always be the shorter (smaller value) in Corona, even if you’re designing a landscape app. If you haven’t read the following guide, please do so… especially the section on “Dynamic Scaling”:

http://docs.coronalabs.com/guide/basics/configSettings/index.html

Best regards,

Brent Sorrentino

Cool thank you!