Screen coordinates when rotating device

I am new to Corona, and have made a variation of the sliding gallery app where I am trying to add device rotation support.

However, it seems that the x and y coordinates does not rotate even if the device rotates. I would have expected the coordinate system to rotate along with the device - i.e. x = 100, y = 100 would still be located at the same point in the upper left corner of the screen. I notice that the display.contentWidth and display.contentHeight change values to correct sizes.

Do I need to somehow translate all coordinates in animations and touch-recognitions for the different orientations ? Please say it isn’t so… [import]uid: 75621 topic_id: 13477 reply_id: 313477[/import]

Hey,

Take a look at this; http://www.burtonsmediagroup.com/blog/2010/07/developing-iphoneipadandroid-applications-with-corona-orientation-change/

Peach :slight_smile: [import]uid: 52491 topic_id: 13477 reply_id: 49752[/import]

I’m really struggling with orientation stuff;

I have build.settings file which contains settings ={orientation={default = “landscapeRight”,supported ={“landscapeRight”, “landscapeLeft”}}} - thus it should only support landscape modes.

My main.lua fiel only contains

local p=display.newImage(“grid-1024x768_B.png”)

However, when I run it in xcode simulator, there is a rotation animation for each orientation I change - i.e. I cycle through all4 positions, and it performs some animation that rotates the screen and the image I have loaded is rotated along with the device (it does not animate, but it flashes and then re-appears in the new orientation).

Any tips ? [import]uid: 75621 topic_id: 13477 reply_id: 49781[/import]

You’re right, it should only support Landscape modes - can you check it on your device to see what happens on rotation and post here? [import]uid: 52491 topic_id: 13477 reply_id: 49871[/import]

*Post edited
It seems like I might have been making changes to the wrong files *blush*.

It works (everywhere) now that I am using the correct files - sorry to have wasted your time.
[import]uid: 75621 topic_id: 13477 reply_id: 49889[/import]

Haha! I’ve seen that happen plenty of times and I’m sure it will eventually happen to me too.

You didn’t waste any time, I’m just glad you got it sorted - well done on figuring it out :slight_smile:

Peach [import]uid: 52491 topic_id: 13477 reply_id: 50150[/import]