Ui XML Camera - BLKTower/TestWiki GitHub Wiki

Table of Contents

Render world-space objects on a UI frame using a custom camera. Camera frames require either a size or autoSize to be set.

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 width="200" height="200" autoSize="true" position="x: 16, y: 1, z: 15" rotation="x: 35, y: 0, z: 0" verticalOffsetInParent="200" />

This XML produces the following UI: image

Related Trigger Function(s):

Render world-space objects on a UI frame using a custom camera

size

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 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" />

Related Trigger Function(s):

position

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 width="200" height="200" size="x: 200, y: 200" position="x: 16, y: 1, z: 15" rotation="x: 35, y: 0, z: 0" />

Related Trigger Function(s):

rotation

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 width="200" height="200" size="x: 200, y: 200" position="x: 16, y: 1, z: 15" rotation="x: 35, y: 0, z: 0" />

Related Trigger Function(s):

discardDepth

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 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"/>

Related Trigger Function(s):

cullingMask

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 width="100" height="100" autoSize="true" position="x: 16, y: 1, z: 15" rotation="x: 35, y: 0, z: 0" cullingMask="1" />

Related Trigger Function(s):

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 width="100" height="100" autoSize="true" position="x: 16, y: 6, z: 15" rotation="x: 35, y: 0, z: 0" cameraBackgroundColor="r: 0, g: 1, b: 0.8, a: 1" />

Related Trigger Function(s):

autoSize

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. 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"/>

Related Trigger Function(s):

⚠️ **GitHub.com Fallback** ⚠️