Type Table Object DisplayObject Library display.* Revision 2017.3060 Keywords content bounds
A read-only table with properties xMin
, xMax
, yMin
, yMax
that represent the boundaries of a display object, in content coordinates.
local rect = display.newRect( 100, 100, 50, 50 ) rect:setFillColor( 1, 0, 0 ) local bounds = rect.contentBounds print( "xMin: ".. bounds.xMin ) -- xMin: 75 print( "yMin: ".. bounds.yMin ) -- yMin: 75 print( "xMax: ".. bounds.xMax ) -- xMax: 125 print( "yMax: ".. bounds.yMax ) -- yMax: 125