Retrieve or change the x-position of the reference point relative to the object’s local origin. It is relative to another point in the object, not to its parent. Conceptually, the reference point is the location about which scaling and rotations occur. Sometimes this is referred to as the registration point. For most display objects, this value defaults to 0, meaning the x-position of the origin and the reference point are the same. This merely defines the reference point, so changing the value of this property does not change the position of the object.
local var = object.xReference object.xReference = value
local rect1 = display.newRect(0, 0, 50, 50) rect1:setFillColor(170, 170, 170) rect1.x = 100 rect1.y = 100 local rect2 = display.newRect(0, 0, 50, 50) rect2:setFillColor(255, 255, 255) rect2.xReference = 50 rect2.x = 100 rect2.y = 100
number: The X-reference value for the object.
Supported on operating systems and platforms for build numbers shown:
- Mac OS X:Corona SDK 1.0
- Windows:Corona SDK 2.0
- iOS:Corona SDK 1.0
- Android:Corona SDK 2.0