Options
All
  • Public
  • Public/Protected
  • All
Menu

Class UICanvas

Hierarchy

Index

Constructors

constructor

Events

onDeserialized

  • onDeserialized(data: any, context: any, builtContext: any): void
  • Parameters

    • data: any
    • context: any
    • builtContext: any

    Returns void

Properties

Readonly entity

entity: Entity & { transform: Transform3D } & { transform2D: Transform2D }

Readonly forceTouchEndExceptEvent

forceTouchEndExceptEvent: Emitter<TouchEvent, TouchInputComponent> = ...

Readonly id

id: number = ...

Readonly interactiveDirtyEvent

interactiveDirtyEvent: Emitter<void, void> = ...

Readonly isDestroyed

isDestroyed: boolean = false

Readonly isDestroying

isDestroying: boolean = false

Readonly priority

priority: number = ...

Readonly treeChangeEvent

treeChangeEvent: Emitter<UILayerChangeType, Entity2D> = ...

Readonly treeDirtyEvent

treeDirtyEvent: Emitter<void, void> = ...

Static Readonly AdaptationType

AdaptationType: Readonly<typeof UIAdaptationType> = ...

Static Priority

Priority: { Align: number; Layout: number; Low: number; Physics: number; Render: number; Tool: number } = ...

Type declaration

  • Align: number
  • Layout: number
  • Low: number
  • Physics: number
  • Render: number
  • Tool: number

Static Optional Serialize

Serialize: (...args: any[]) => any

Type declaration

    • (...args: any[]): any
    • Parameters

      • Rest ...args: any[]

      Returns any

Accessors

UITreeRoot

  • deprecated

    Returns Transform2D

active

  • get active(): boolean
  • set active(value: boolean): void
  • Returns boolean

  • Parameters

    • value: boolean

    Returns void

activeInHierarchy

  • get activeInHierarchy(): boolean
  • 在场景树中是否active

    readonly
    memberof

    Component

    Returns boolean

adaptationType

  • get adaptationType(): UIAdaptationType
  • set adaptationType(val: UIAdaptationType): void
  • 正交模式,屏幕适配的模式

    Returns UIAdaptationType

  • 正交模式,屏幕适配的模式

    Parameters

    • val: UIAdaptationType

    Returns void

castShadow

  • get castShadow(): boolean
  • set castShadow(s: boolean): void
  • 是否投射阴影

    Returns boolean

  • 是否投射阴影

    Parameters

    • s: boolean

    Returns void

cullingMask

  • get cullingMask(): number
  • set cullingMask(value: number): void
  • 剔除掩码,由entity的layer计算得出。
    剔除时将使用该值与Camera的cullingMask做按位与,有值时才渲染。

    Returns number

  • 剔除掩码,由entity的layer计算得出。
    剔除时将使用该值与Camera的cullingMask做按位与,有值时才渲染。

    deprecated

    Parameters

    • value: number

    Returns void

designResolution

  • get designResolution(): Vector2
  • set designResolution(designSize: Vector2): void
  • Returns Vector2

  • Parameters

    Returns void

deviceResolution

  • get deviceResolution(): Vector2
  • set deviceResolution(resolution: Vector2): void
  • Returns Vector2

  • Parameters

    Returns void

dynamicBatch

  • get dynamicBatch(): boolean
  • set dynamicBatch(val: boolean): void
  • 是否开启3D Batch。

    Returns boolean

  • 是否开启3D Batch。

    Parameters

    • val: boolean

    Returns void

lastFrameVisible

  • get lastFrameVisible(): boolean
  • 上一帧是否被任意相机渲染。

    Returns boolean

lightMapIndex

  • get lightMapIndex(): number
  • set lightMapIndex(s: number): void
  • 光照贴图索引。

    Returns number

  • 光照贴图索引。

    Parameters

    • s: number

    Returns void

lightMapScaleOffset

  • get lightMapScaleOffset(): Vector4
  • set lightMapScaleOffset(l: Vector4): void
  • 光照贴图的scaleOffset
    暂时不支持 meshRenderer.lightMapScaleOffset.x = 1这种写法

    Returns Vector4

  • 光照贴图的scaleOffset
    暂时不支持 meshRenderer.lightMapScaleOffset.x = 1这种写法

    Parameters

    Returns void

lightsFA

  • get lightsFA(): default[]
  • Returns default[]

material

  • 主材质。

    Returns Material

  • 主材质。

    Parameters

    Returns void

materialCount

  • get materialCount(): number
  • 获取当前材质数量。

    Returns number

mesh

  • get mesh(): Mesh
  • set mesh(val: Mesh): void
  • 设置该MeshRenderer渲染的Mesh。

    Returns Mesh

  • 设置该MeshRenderer渲染的Mesh。

    Parameters

    Returns void

receiveShadow

  • get receiveShadow(): boolean
  • set receiveShadow(s: boolean): void
  • 是否接收阴影

    Returns boolean

  • 是否接收阴影

    Parameters

    • s: boolean

    Returns void

resolution

  • get resolution(): DeepImmutableObject<Vector2>
  • duplicate

    Returns DeepImmutableObject<Vector2>

sharedMaterial

  • 获取共享主材质。

    Returns Material

worldBoundBall

  • 世界坐标系下的包围球。

    Returns BoundBall

Methods

addAffectLight

  • addAffectLight(light: default): void
  • Parameters

    • light: default

    Returns void

addMaterial

addToRenderList

  • addToRenderList(list: Uint32Array, index: number): void
  • Parameters

    • list: Uint32Array
    • index: number

    Returns void

addUILayerRoot

  • addUILayerRoot(rootEntity: Entity2D): void
  • Parameters

    • rootEntity: Entity2D

    Returns void

destroy

  • destroy(): void

getMaterialAtIndex

  • getMaterialAtIndex(index: number): Material
  • 获取第index位材质,当第一次获取成功时,该材质会被拷贝,并将替换材质。

    Parameters

    • index: number

    Returns Material

getShaderDef

  • getShaderDef(marcos: {}): string | number
  • Parameters

    • marcos: {}
      • [name: string]: string | number | boolean

    Returns string | number

getSharedMaterialAtIndex

  • getSharedMaterialAtIndex(index: number): Material
  • 获取第index位材质的sharedMaterial,此操作不会进行材质拷贝。

    Parameters

    • index: number

    Returns Material

getTypeName

  • getTypeName(): string

isDetached

  • isDetached(): boolean

markInteractiveDirty

  • markInteractiveDirty(): void
  • Returns void

markLayerRootDirtyByTransform2D

  • markLayerRootDirtyByTransform2D(transform2D: Transform2D): void
  • Parameters

    Returns void

markTreeDirty

  • markTreeDirty(): void
  • Returns void

markUILayerRootDirty

  • markUILayerRootDirty(rootEntity: Entity2D): void
  • Parameters

    • rootEntity: Entity2D

    Returns void

markUILayerRootVisbleDirty

  • markUILayerRootVisbleDirty(rootEntity: Entity2D): void
  • Parameters

    • rootEntity: Entity2D

    Returns void

minimizeMaterialsToShortest

  • minimizeMaterialsToShortest(): void

refreshAffectLight

  • refreshAffectLight(): void

refreshLightsUniformFA

  • refreshLightsUniformFA(): void

refreshUILayerRoot

  • refreshUILayerRoot(rootEntity: Entity2D): void
  • Parameters

    • rootEntity: Entity2D

    Returns void

removeAffectLight

  • removeAffectLight(light: default): void

removeUILayerRoot

  • removeUILayerRoot(rootEntity: Entity2D): void
  • Parameters

    • rootEntity: Entity2D

    Returns void

resetProperties

  • resetProperties(): void

setLightsUniformDirty

  • setLightsUniformDirty(): void

setMaterialAtIndex

  • setMaterialAtIndex(material: Material, index: number): void

Generated using TypeDoc