Hi,
I’ve got a display group with an object inside it. If I then move the group how would it be possible to get the new coordiantes of the object inside?
Simplified code -
require ( “ui” )
layer1 = display.newGroup ()
local obj = display.newCircle ( 100, 100, 20 )
obj:setFillColor ( 0, 255, 0, 255 )
layer1:insert ( obj )
layer1.x = 55 – move the display group along a bit
checkX = ui.newLabel{
bounds = { 50, 50, 30, 40 },
text = obj.x, – just using this to demonstrate that the x coordinate remains 100
textColor = { 0, 255, 100, 255 },
size = 50,
align = “center”
}
Now I was hoping that obj.x would be 155 but it remains 100. What should I be doing to retrieve it’s new x value?
Thanks in advance,
Will [import]uid: 4577 topic_id: 3521 reply_id: 303521[/import]