Ui XML Reference\Camera

Render world-space objects on a UI frame using a custom camera. Camera frames require either a cameraSize or cameraAutoSize to be set.
Note that Camera doesn't support Flex layouts.

Example Usage

<!-- This camera frame's camera will be centered on the middle of the map, rotated to face down. 
Placing a unit at x = 16, z = 16 will display it in the camera frame. -->
<Camera layout="legacy" width="200" height="200" cameraAutoSize="true" cameraPosition="x: 16, y: 1, z: 15" cameraRotation="x: 35, y: 0, z: 0" verticalOffsetInParent="200" />

This XML produces the following UI:
image

size

Value type: vector2

⚠️Warning⚠️: This attribute was deprecated at editor version: 0.33.0, and will be removed after 90 days.

Description


The size for the camera frame - this is the resolution of the camera frame. This does not impact the width or height of the camera frame. The resolution values are not capped, but excessively high resolutions will consume large amounts of RAM. If autoSize is set to false and no explicit size is set, the camera frame will have a resolution of 1x1.

Example Usage

<Camera width="200" height="200" size="x: 400, y: 400" position="x: 16, y: 1, z: 15" rotation="x: 35, y: 0, z: 0" />

cameraSize

Value type: vector2

Description


The size for the camera frame - this is the resolution of the camera frame. This does not impact the width or height of the camera frame. The resolution values are not capped, but excessively high resolutions will consume large amounts of RAM. If cameraAutoSize is set to false and no explicit size is set, the camera frame will have a resolution of 1x1.

Example Usage

<Camera layout="legacy" width="200" height="200" cameraAutoSize="true" cameraPosition="x: 16, y: 1, z: 15" cameraRotation="x: 35, y: 0, z: 0" />

position

Value type: vector3

⚠️Warning⚠️: This attribute was deprecated at editor version: 0.33.0, and will be removed after 90 days.

Description


The position for the camera frame's camera. The default position for a new camera frame is {0, 0, 0}.

Example Usage

<Camera width="200" height="200" size="x: 200, y: 200" position="x: 16, y: 1, z: 15" rotation="x: 35, y: 0, z: 0" />

cameraPosition

Value type: vector3

Description


The position for the camera frame's camera. The default position for a new camera frame is {0, 0, 0}.

Example Usage

<Camera layout="legacy" width="200" height="200" cameraAutoSize="true" cameraPosition="x: 16, y: 1, z: 15" cameraRotation="x: 35, y: 0, z: 0" />

rotation

Value type: vector3

⚠️Warning⚠️: This attribute was deprecated at editor version: 0.33.0, and will be removed after 90 days.

Description


The 3D rotation for the camera frame's camera. The default rotation for a new camera frame is {0, 0, 0}.

Example Usage

<Camera width="200" height="200" size="x: 200, y: 200" position="x: 16, y: 1, z: 15" rotation="x: 35, y: 0, z: 0" />

cameraRotation

Value type: vector3

Description


The 3D rotation for the camera frame's camera. The default rotation for a new camera frame is {0, 0, 0}.

Example Usage

<Camera layout="legacy" width="200" height="200" cameraAutoSize="true" cameraPosition="x: 16, y: 1, z: 15" cameraRotation="x: 35, y: 0, z: 0" />

discardDepth

Value type: boolean

⚠️Warning⚠️: This attribute was deprecated at editor version: 0.33.0, and will be removed after 90 days.

Supports data binding

Description


The discard depth status for the camera frame, where true discards depth and false does not.

Example Usage

<Camera width="200" height="200" size="x: 200, y: 200" position="x: 16, y: 1, z: 15" rotation="x: 35, y: 0, z: 0" discardDepth="true"/>

cameraDiscardDepth

Value type: boolean

Supports data binding

Description


The discard depth status for the camera frame, where true discards depth and false does not.

Example Usage

<Camera layout="legacy" width="200" height="200" cameraAutoSize="true" cameraPosition="x: 16, y: 1, z: 15" cameraRotation="x: 35, y: 0, z: 0" cameraDiscardDepth="true"/>

cullingMask

Value type: number

⚠️Warning⚠️: This attribute was deprecated at editor version: 0.33.0, and will be removed after 90 days.

Supports data binding

Description


The culling mask for the camera frame. Odd values will remove the terrain, even values will remove everything.

Example Usage

<Camera width="100" height="100" autoSize="true" position="x: 16, y: 1, z: 15" rotation="x: 35, y: 0, z: 0" cullingMask="1" />

cameraCullingMask

Value type: number

Supports data binding

Description


The culling mask for the camera frame. Odd values will remove the terrain, even values will remove everything.

Example Usage

<Camera layout="legacy" width="200" height="200" cameraAutoSize="true" cameraPosition="x: 16, y: 1, z: 15" cameraRotation="x: 35, y: 0, z: 0" cameraCullingMask="1" />

cameraBackgroundColor

Value type: color

Description


The background color for the camera frame. This background color will only color empty space; or anything that isn't filled by terrain or units. If combined with a culling mask, any space that is culled will be filled with this color.

Example Usage

<Camera layout="legacy" width="200" height="200" cameraAutoSize="true" cameraPosition="x: 16, y: 1, z: 15" cameraRotation="x: 35, y: 0, z: 0" cameraCullingMask="1" cameraBackgroundColor="r: 0, g: 1, b: 0.8, a: 1" />

autoSize

Value type: boolean

⚠️Warning⚠️: This attribute was deprecated at editor version: 0.33.0, and will be removed after 90 days.

Supports data binding

Description


The autoSize status for the camera frame, where true means the camera frame will autosize and false means it does not. AutoSize will attempt to match the resolution with the height and width of the camera frame. If autoSize is set to false and no explicit size is set, the camera frame will have a resolution of 1x1. This attribute cannot be set via an API call.

Example Usage


Example Usage:

<Camera width="400" height="400" autoSize="true" position="x: 16, y: 1, z: 15" rotation="x: 35, y: 0, z: 0"/>

cameraAutoSize

Value type: boolean

Supports data binding

Description


The autoSize status for the camera frame, where true means the camera frame will autosize and false means it does not. CameraAutoSize will attempt to match the resolution with the height and width of the camera frame. If autoSize is set to false and no explicit cameraSize is set, the camera frame will have a resolution of 1x1. This attribute cannot be set via an API call.

Example Usage


Example Usage:

<Camera layout="legacy" width="200" height="200" cameraAutoSize="true" cameraPosition="x: 16, y: 1, z: 15" cameraRotation="x: 35, y: 0, z: 0"/>