Hi,
I am trying to create a landscape based project. There is no native support for orientation change other than setting it in the config.lua files, is there?
Now I am trying to place all the elements on this layout. I am then trying to scale the whole group to support iPhone3 and iPhone4 resolutions.
The issue,
- I create a displayGroup and place a background in it of 960x640 I have to play with the referencePoint and set it for each subsequent element, the most irritating part, maybe I am missing something here, is that these do not align with the 0,0 of the group.
IMHO, any element placed on the group is relative to the group, so
local theGroup = display.newGroup()
local theBackground = display.newImageRect(theGroup, "somebackground.png", 960, 640)
local theImage1 = display.newImage(theGroup, "someImage1.png")
theImage:setReferencePoint(display.TopLeftReferencePoint)
theImage.x=0
theImage.y=0
--Now turn the whole thing around and scale it for iPhone3
theGroup:setReferencePoint(display.BottomLeftReferencePoint)
theGroup:rotate(90)
theGroup.x=0
theGroup.y=0
theGroup:scale(0.5,0.5)
This logically should work with the background image covering the whole display area and be scaled for the iPhone3
BUT, the images are all over the place
The issue is why do I have to set all this, there must be an easier way that I am missing and why do I have to use TopLeft for some and BottomLeft for some images?
shouldn’t the co-ordinate system be consistent?
cheers,
Jayant C Varma
[import]uid: 3826 topic_id: 3390 reply_id: 303390[/import]