Hi @dmglakewood,
You can use the “object.contentBounds” property for this, as follows:
[lua]
local box = display.newRect( 100,100,200,200 ) ; box:setFillColor(255)
local function boundCheck()
local bounds = box.contentBounds
print("xMin: "… bounds.xMin) – xMin: 100
print("yMin: "… bounds.yMin) – yMin: 100
print("xMax: "… bounds.xMax) – xMax: 150
print("yMax: "… bounds.yMax) – yMax: 150
end
transition.to( box, { time=20000, rotation=360 } )
timer.performWithDelay( 1000, boundCheck, 0 )
[/lua]
Notice how the values change as the box rotates. Basically, it’s just giving you the outer bounds of a theoretical rectangle drawn around the object.
If you’re using physics, the approach could be different… you could use a big sensor for the region the object isn’t supposed to be within (above the line) and ensure that all objects have exited that region.
Hope this helps!
Brent