Array APIs

Ashley's avatar
Medal
Construct Team Founder
Published 11 Sep, 2018
159 words
<1 min

The built-in Array plugin SDK instance exposes the following APIs.

At(x, y, z)

Retrieve an element from the array at the given X, Y and Z co-ordinates. For one or two dimensional access, pass 0 for the unused components.

Set(x, y, z, val)

Set an element in the array at the given X, Y and Z co-ordinates. For one or two dimensional access, pass 0 for the unused components.

SetSize(w, h, d)

Set the size of the array in up to three dimensions. For one or two dimensional arrays, pass 1 for the unused dimensions. (Note passing 0 for any dimension will create an array with zero elements that cannot store any data.) If the array grows, new elements have the value 0. If the array shrinks, elements are removed.

GetWidth()

GetHeight()

GetDepth()

Retrieve the current dimensions of the array.