Accessing "actual" coordinate of a group child

I have objects attached to a group (a point at the top, a point in the middle, and a point in the bottom). I’m trying to track those specific points because things move and rotate and so forth, and I want to know when the group is moved and rotated, what the actual “position” of one of the dots is. No matter where on the screen it is it always shows up as 0,0. How can I see what its ACTUAL position on screen is? i.e. 23,519. Thanks! [import]uid: 6317 topic_id: 1277 reply_id: 301277[/import]

Hmm… did you try to use the stageBounds?

object.stageBounds is a table with properties xMin, xMax, yMin, yMax in screen coordinates… [import]uid: 6928 topic_id: 1277 reply_id: 3443[/import]

this doesn’t actually give the global x,y positions of the item on the “screen”. I have items in a group that are at position (-2, 50) within that group, and the group moves. While the group is moving, i want to find out the global (x,y) position of those elements. Still haven’t been able to find a solution for this… [import]uid: 6317 topic_id: 1277 reply_id: 3871[/import]

Dunno… it works for me… it does what you say it does not for me :slight_smile:

local grp=display.newGroup()  
local rect=display.newRect(0,0,20,20)  
rect:setFillColor(255,255,255)  
grp:insert(rect)  
  
local sb=rect.stageBounds  
print(sb.xMin, sb.yMin, sb.xMax, sb.yMax)  
  
-- prints 0,0,20,20  
  
grp.x=-5  
  
local sb=rect.stageBounds  
print(sb.xMin, sb.yMin, sb.xMax, sb.yMax)  
  
-- prints -5, 0, 15, 20  
  
grp.x=0  
rect.x=-5  
  
local sb=rect.stageBounds  
print(sb.xMin, sb.yMin, sb.xMax, sb.yMax)  
  
-- prints -15, 0, 5, 20 (because x on the rect is placed in center...  
  
rect:setReferencePoint(display.TopLeftReferencePoint)  
  
rect.x=-5  
  
local sb=rect.stageBounds  
print(sb.xMin, sb.yMin, sb.xMax, sb.yMax)  
  
-- prints -5, 0, 15, 20  
  
grp.x=50  
grp.y=50  
  
local sb=rect.stageBounds  
print(sb.xMin, sb.yMin, sb.xMax, sb.yMax)  
  
-- prints 45, 50, 65, 70  

[import]uid: 6928 topic_id: 1277 reply_id: 3874[/import]