Options
All
  • Public
  • Public/Protected
  • All
Menu

Root component for UI elements (entities with RectTransform and Transform components).

Hierarchy

Index

Constructors

constructor

  • Parameters

    • Optional camera: Entity
    • Optional uiScaleMode: UIScaleMode
    • Optional referenceResolution: Vector2
    • Optional matchWidthOrHeight: number

    Returns UICanvas

Properties

camera

camera: Entity

The entity with the Camera2D component used for layouting calculations.

matchWidthOrHeight

matchWidthOrHeight: number

Scales the Canvas to match the width or height of the reference resolution, or a combination of width and height.

A value of 0 scales the Canvas according to the difference between the current screen resolution width and the reference resolution width.

A value of 1 scales Canvas according to the difference between the current screen resolution height and the reference resolution height.

Values between 0 and 1 scale the Canvas based on a combination of the relative width and height.

referenceResolution

referenceResolution: Vector2

The resolution the UI layout is designed for (in pixels).

uiScaleMode

uiScaleMode: UIScaleMode

How UI elements in the Canvas are scaled.

Static _isSharedComp

_isSharedComp: boolean

Static _size

_size: number

Static _view

_view: any

Static camera

camera: EntityComponentFieldDesc

Static cid

cid: number

Static matchWidthOrHeight

matchWidthOrHeight: ComponentFieldDesc

Static referenceResolution

referenceResolution: Vector2ComponentFieldDesc

Methods

Static _dtorFn

  • Parameters

    Returns void

Static _fromPtr

  • Parameters

    Returns UICanvas

Static _tempHeapPtr

  • Parameters

    Returns number

Static _toPtr

  • Parameters

    Returns void

Generated using TypeDoc