Skip to content

format

typescript
Control.rectTransform

class: 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_nametypedescription

reture

typedescription
RectTransformThe 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;