Shapes
constShapes:object
Defined in: client/api.d.ts:7752
World-space shapes drawn on this client only: rings, spheres, boxes, cylinders, polygons and lines, for areas, previews and markers. They are real geometry, so walls hide them, and see-through when their alpha is under 1. Keys belong to the calling resource, and its shapes go when it stops.
Type Declaration
Section titled “Type Declaration”create()
Section titled “create()”create(
key,shape):boolean
Creates or replaces a shape. It appears on the next frame, and comes back by itself after a level change. Throws a TypeError on a bad shape, and an Error at 1024 shapes on this client.
Parameters
Section titled “Parameters”string
Stable key, at most 128 characters; creating again replaces the shape.
The shape and how it looks.
Returns
Section titled “Returns”boolean
true
destroy()
Section titled “destroy()”destroy(
key):boolean
Destroys a shape.
Parameters
Section titled “Parameters”string
Key passed to create.
Returns
Section titled “Returns”boolean
false when no shape has the key
destroyAll()
Section titled “destroyAll()”destroyAll():
number
Destroys every shape this resource made.
Returns
Section titled “Returns”number
How many there were.
get(
key):ShapeOptions|null
A shape’s fields as they stand, defaults filled in, or null.
Parameters
Section titled “Parameters”string
Key passed to create.
Returns
Section titled “Returns”ShapeOptions | null
keys()
Section titled “keys()”keys():
string[]
Keys of this resource’s shapes.
Returns
Section titled “Returns”string[]
setVisible()
Section titled “setVisible()”setVisible(
key,visible):boolean
Shows or hides a shape.
Parameters
Section titled “Parameters”string
Key passed to create.
visible
Section titled “visible”boolean
false hides it without destroying it.
Returns
Section titled “Returns”boolean
false when no shape has the key
update()
Section titled “update()”update(
key,changes):boolean
Changes some of a shape’s fields; the rest keep their values. Moving or recoloring is cheap; changing its size rebuilds it. Throws like create.
Parameters
Section titled “Parameters”string
Key passed to create.
changes
Section titled “changes”Partial<ShapeOptions>
Only the fields to change; the type can’t change.
Returns
Section titled “Returns”boolean
false when no shape has the key