类型 表格 对象 显示对象 库 display.* 修订版本 版本 2024.3703 关键词 内容边界
一个只读表格,具有属性 xMin
、xMax
、yMin
、yMax
,表示 显示对象 的边界,以内容坐标表示。
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