Rect Transform#

class UI.RectTransform()#

A Unity engine Rect Transform for a UI object. See the Unity manual for more details.

RectTransform.getPosition()#
RectTransform.setPosition(value)#

Position of the rectangles pivot point relative to the anchors.

Property:

Can be read or written

Return type:

[number, number]

RectTransform.getLocalPosition()#
RectTransform.setLocalPosition(value)#

Position of the rectangles pivot point relative to the anchors.

Property:

Can be read or written

Return type:

[number, number, number]

RectTransform.getSize()#
RectTransform.setSize(value)#

Width and height of the rectangle.

Property:

Can be read or written

Return type:

[number, number]

RectTransform.getUpperRight()#
RectTransform.setUpperRight(value)#

Position of the rectangles upper right corner relative to the anchors.

Property:

Can be read or written

Return type:

[number, number]

RectTransform.getLowerLeft()#
RectTransform.setLowerLeft(value)#

Position of the rectangles lower left corner relative to the anchors.

Property:

Can be read or written

Return type:

[number, number]

RectTransform.setAnchor(value)#

Set the minimum and maximum anchor points as a fraction of the size of the parent rectangle.

Property:

Write-only, cannot be read

Return type:

[number, number]

RectTransform.getAnchorMax()#
RectTransform.setAnchorMax(value)#

The anchor point for the lower left corner of the rectangle defined as a fraction of the size of the parent rectangle.

Property:

Can be read or written

Return type:

[number, number]

RectTransform.getAnchorMin()#
RectTransform.setAnchorMin(value)#

The anchor point for the upper right corner of the rectangle defined as a fraction of the size of the parent rectangle.

Property:

Can be read or written

Return type:

[number, number]

RectTransform.getPivot()#
RectTransform.setPivot(value)#

Location of the pivot point around which the rectangle rotates, defined as a fraction of the size of the rectangle itself.

Property:

Can be read or written

Return type:

[number, number]

RectTransform.getRotation()#
RectTransform.setRotation(value)#

Rotation, as a quaternion, of the object around its pivot point.

Property:

Can be read or written

Return type:

[number, number, number, number]

RectTransform.getScale()#
RectTransform.setScale(value)#

Scale factor applied to the object in the x, y and z dimensions.

Property:

Can be read or written

Return type:

[number, number, number]