Skip to main content

Type Alias: AddCanvasComponentOptions

AddCanvasComponentOptions = ScreenSpaceCanvasFields | WorldSpaceCanvasFields & CanvasInputOptions & object

Defined in: ui/components/canvas-component.ts:67

Type Declaration​

camera​

camera: number

The entity id of the camera this canvas draws through. For renderMode: 'screenSpace' (the default), this is the dedicated UI camera createUiCanvas creates, and createUiLayoutEcsSystem keeps its verticalWorldUnits in sync with the canvas's resolved root rect every frame. For renderMode: 'worldSpace', this is typically the game's own world camera - createUiLayoutEcsSystem never mutates it, since a world-space canvas's rect comes from its own RectTransformEcsComponent and entity hierarchy, not the render destination's size.