Hello!
I guess I have a problem understanding the way reference points work. Consider the following code (partially taken from the “clock” example:
[code]local clock = display.newGroup()
local background = display.newImage( “purple.png” )
clock:insert( background, true )
background.x = 160; background.y = 240
local b = clock.stageBounds;
print(b.xMin…"…"…b.xMax…", “…b.yMin…”…"…b.yMax);
print(clock.xReference…","…clock.yReference)
– Set the rotation point to the center of the screen
clock:setReferencePoint( display.CenterReferencePoint )
b = clock.stageBounds;
print(b.xMin…"…"…b.xMax…", “…b.yMin…”…"…b.yMax);
print(clock.xReference…","…clock.yReference)[/code]
The loaded image (“purple.png”) is 480x480 pixels wide - the group should thus be of the same size. As a consequence, the stage bounds initally range from -80,0 to 400,480 and the reference point is at 0,0 (x,y are 0,0 as well)
After setting the reference point to the center of the group (or image), the stage bounds remain the same, but x,y and the reference point move to 160,240
Is that correct? I would have either expected that the stagebounds initially range from 0,0 to 480,480 (initially) or the reference point moves to 240,240 (at the end)
Can anybody explain this, please?
[import]uid: 4331 topic_id: 973 reply_id: 300973[/import]