Skip to reading
PCA Script Programming

Builtins: Values and conversion

Edition 0.86.4.1 HF1

0.86.4.1 Hotfix 1 edition. Earlier lessons and screenshots retain their original version context; revised references and supplements describe the newer behavior.

Download PDFView PDF page
On this page

vector2()#

Code example
vector2(x = 0, y = 0)

Construct a two-coordinate value. Use it for 2D positions and offsets.

Returns: Vector2.

Code example
vector2(120, 80)

vector3()#

Code example
vector3(x = 0, y = 0, z = 0)

Construct a three-coordinate value. In a normal 3D room, Y is height and X/Z span the floor.

Returns: Vector3.

Code example
vector3(2, 0, -3)

color()#

Code example
color(text) or color(r, g, b, a = 1)

Construct a color from an HTML-style string or normalized numeric components.

Returns: Color.

Code example
color("#88bbff")

Invalid color text falls back to white. Components normally use 0 to 1; a hex string is often easier to copy from a designer.

len() and aliases#

Code example
len(value)

Count text characters or array/dictionary entries.

Returns: Integer size; 0 for null or an unsupported value.

Aliases: length()

Code example
len(["key", "note"])
Page 51 of 357Permalink
Go to page