Simple way of getting the outer (left, right, top, bottom) coordinates of an object?

I’m trying to get the outer x and y coordinates of an object. I need the left, right, top and bottom positions. I’ve found two ways to do it, but it all seems kind of ugly, and I guess there are some better ways.

  1. I could set the reference point to the top left and do my calculations from there. This is easy, but then I’d have change the reference point again to the middle.

self:setReferencePoint( display.TopLeftReferencePoint )
–do logic here
print(self.x)
self:setReferencePoint( display.CenterReferencePoint )

  1. I could calculate the left position by getting the x position - width/2. This also seems kind of ugly.
    Are there any better ways for just getting the outer positions? [import]uid: 13180 topic_id: 7481 reply_id: 307481[/import]

http://developer.anscamobile.com/reference/index/objectcontentbounds [import]uid: 12108 topic_id: 7481 reply_id: 26478[/import]

Just what I was looking for! Thanks a lot! [import]uid: 13180 topic_id: 7481 reply_id: 26483[/import]