Display objects layout and orientation

I find this a little confusing...

On iOS, if you want to support all orientations, do scenes need to be able to layout themselves 4 different ways? (portrait, portrait upside down, landscape left and landscape right)

+ faceUp and faceDown

Only if you want them to!

no they are free if you add all four orientations

portrait, portrait upside down, landscape left and landscape right

It turns out that I have lots of issues when it comes to the coordinate system and orientation changes.

I understood it all when I had fixed the orientation to "landscape right", but things get weird and more tedious when orientation starts to change and I need to re-layout my scenes.

In fact, the coordinate system is somewhat under-documented, with a single picture, when more could be useful. (to illustrate object.x, object.y, object.xOrigin, object.xReference, object.xScale, etc.)

On top of that I see some variations in the behavior of display.newImage vs. display.newImageRect. It seems I can position the object created with newImage by assuming its x and y represent its top left corner.
The object created with newImageRect, however, if I assign its x and y, it seems I change the position of its center point.

I need to run a bunch of small tests to figure it all out.

views:1281 update:2011/10/1 9:04:19
corona forums © 2003-2011