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....

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 ?

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?

*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.

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 :)

Peach

views:1317 update:2011/10/11 15:24:38
corona forums © 2003-2011