issue with contentWidth and contentHeight in Windows simulator

I built a rectangle using a corner graphic and a side graphic. The side graphic is stretched to the width of the device using contentWidth and the length of the rectangle is contentHeight -160. It works as expected unless the simulated device is turned landscape. If I attempt to create the rectangle while the device is in landscape it comes out the wrong proportions. In fact it isn’t even a rectangle.

Any idea why this is happening? Is it a simulator issue or an issue with the way contentWidth and contentHeight is calculated?

Thanks for the advice. [import]uid: 191108 topic_id: 35620 reply_id: 335620[/import]

display.contentWidth and display.contentHeight are determined by what you put in your config.lua, and we flip the values when you rotate. So if your width is 320 and your height is 480 in your config.lua then in Portrait mode, display.contentWidth will be 320 and display.contentHeight will be 480. If you rotate it landscape, then display.contentWidth will be 480 and display.contentHeight will be 320.

I think we would need to see your code before we could trouble shoot any further. [import]uid: 199310 topic_id: 35620 reply_id: 141632[/import]

Thank you, that answer revealed what I needed: that the definition of contentWidth and contentHeight are dependent on orientation. What threw me off was that I had become accustomed to the way system coordinates did not change with orientation and had assumed it worked the same. [import]uid: 191108 topic_id: 35620 reply_id: 141982[/import]

display.contentWidth and display.contentHeight are determined by what you put in your config.lua, and we flip the values when you rotate. So if your width is 320 and your height is 480 in your config.lua then in Portrait mode, display.contentWidth will be 320 and display.contentHeight will be 480. If you rotate it landscape, then display.contentWidth will be 480 and display.contentHeight will be 320.

I think we would need to see your code before we could trouble shoot any further. [import]uid: 199310 topic_id: 35620 reply_id: 141632[/import]

Thank you, that answer revealed what I needed: that the definition of contentWidth and contentHeight are dependent on orientation. What threw me off was that I had become accustomed to the way system coordinates did not change with orientation and had assumed it worked the same. [import]uid: 191108 topic_id: 35620 reply_id: 141982[/import]