format
typescript
RectTransform.rectclass: RectTransform
description
The position and size of RectTransform in the screen coordinate system.
parameter
| param_name | type | description |
|---|
reture
| type | description |
|---|---|
Rect | The position and size in the screen coordinate system. |
code example
typeScript
let go = new GameObject("ui");
let uiComponent = go.AddComponent<UIComponent>(UIComponent);
let canvas = uiComponent.canvas;
let button = canvas.FindChild("Button");
let rectTransform = button.rectTransform;
rectTransform.rect;