[lua]
local group = display.newGroup() – Create a group
local rect = display.newRect( 0, 0, 10, 20 ) – Create a rectangle object
group:insert( rect ) – add rect to group
group.x = 100; group.y = 200 – move the group
rect:setReferencePoint( display.TopLeftReferencePoint )
rect.x = 5
rect.y = 10
rectContentX, rectContentY = rect:localToContent( 0, 0 )
groupContentX, groupContentY = group:localToContent( 0, 0 )
print( "group’s position on screen: ", groupContentX, groupContentY ) – prints 100, 200
print( "group.x,y: ", group.x, group.y ) – prints 100,200
print( "rect’s position on screen: ", rectContentX, rectContentY ) – prints 110, 220
print( "rect.x,y: ", rect.x, rect.y ) – prints 5, 10
–nice.
[/lua]