format
typescript
Control.rectTransformclass: Control
description
The RectTransform component of a UI control.
RectTransform is a unique component in UI controls that provides position, size, rotation, and anchor information for UI controls, allowing for control over the transformation and layout of UI controls.
parameter
| param_name | type | description |
|---|
reture
| type | description |
|---|---|
RectTransform | The RectTransform component. |
code example
typeScript
let go = new GameObject("ui");
let uiComponent = go.AddComponent<UIComponent>(UIComponent);
let canvas = uiComponent.canvas;
let button = canvas.FindChild("Button");
button.rectTransform;