format
typescript
RectTransform.IsContain(value)class: RectTransform
description
Check if a point is within the rectangular range of a RectTransform.
parameter
| param_name | type | description |
|---|---|---|
| value | Vector2 | The coordinates of the point to be checked. |
reture
| type | description |
|---|---|
boolean | Whether the point is within the rectangular range of the RectTransform. |
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.IsContain(new Vector2(1,1));