Skip to content

Canvas (JavaScript)

Canvas

Scripting Name:Insight.Canvas

GUI 画布。

Properties


scaleFactor

type : number

(只读)缩放系数。

isRootCanvas

type : boolean

(只读)是否是根画布。

view

type : Insight.Matrix4x4

(只读)

referencePixelPerUnit

type : number

(只读)

viewProjection

type : Insight.Matrix4x4

(只读)

renderMode

type : int

Methods


toString

public string toString();

将 canvas 内容以一定格式转为 string 类型。

// sample:
var canvas = Insight.GameObject.Find("Canvas").getComponent("Canvas", 0);Insight.Debug.Log(canvas.tostring());

Inherited Properties(继承自 Component)


enabled

type : boolean

该组件是否是可用的。

gameObject

type : Insight.GameObject

(只读)该组件所依附的 GameObject。

isActiveAndEnabled

type : boolean

(只读)该组件是否可用,且其依附的 GameObject 是否是活跃状态。

name

type : string

(只读)所依附的 GameObject 的名称。

tag

type : string

(只读)所依附的 GameObject 的 Tag。

⚠️ 暂时未启用

transform

type :Insight.Transform

(只读)所依附的 GameObject 的 transform。