Skip to content

format

typescript
Control.canvas

class: Control

description

The Canvas that the current control is on.

The Canvas can be thought of as the drawing panel for UI elements. It controls the rendering of UI elements and other properties.

parameter

param_nametypedescription

reture

typedescription
Canvas|nullThe Canvas that the control is on.

code example

typeScript
let go = new GameObject("ui");
let uiComponent = go.AddComponent<UIComponent>(UIComponent);
let canvas = uiComponent.canvas;		
let button = canvas.FindChild("Button");
button.canvas;