object._properties

类型 字符串
显示.*
版本 2024.3703 版本
关键字 自省,属性
另请参阅 object._defined
object._lastChange
json.prettify()

概述

提供对所有对象属性值视图的只读属性。

如需更多自省选项,请参阅 object._definedobject._lastChange

示例

local json = require( "json" )

local line = display.newLine( 200, 90, 227, 165 )
line.rotation = 45

print("line._properties: " .. json.prettify( line._properties ) )
--> line._properties: {
-->   "alpha":1,
-->   "anchorSegments":"false",
-->   "anchorX":0.5,
-->   "anchorY":0.5,
-->   "blendMode":"normal",
-->   "contentBounds":{
-->     "xMin":198,
-->     "xMax":229,
-->     "yMax":167,
-->     "yMin":88
-->   },
-->   "contentHeight":79,
-->   "contentWidth":31,
-->   "height":79,
-->   "isHitTestMasked":"false",
-->   "isHitTestable":"false",
-->   "isVisible":"true",
-->   "maskRotation":0,
-->   "maskScaleX":0,
-->   "maskScaleY":0,
-->   "maskX":0,
-->   "maskY":0,
-->   "rotation":45,
-->   "stroke":{
-->     "blendMode":"normal",
-->     "a":1,
-->     "r":1,
-->     "blendEquation":"add",
-->     "effect":"nil",
-->     "g":1,
-->     "b":1
-->   },
-->   "strokeWidth":1,
-->   "width":31,
-->   "x":200,
-->   "xScale":1,
-->   "y":90,
-->   "yScale":1
--> }