The localAnimator table provides bindings used by client side animation scripts (e.g. on objects and active items) to set drawables/lights and perform rendering actions.


void localAnimator.playAudio(String sound, [int loops], [float volume])

Immediately plays the specified sound, optionally with the specified loop count and volume.


void localAnimator.spawnParticle(Json particleConfig, Vec2F position)

Immediately spawns a particle with the specified name or configuration at the specified position.


void localAnimator.addDrawable(Drawable drawable, [String renderLayer])

Adds the specified drawable to the animator's list of drawables to be rendered. If a render layer is specified, this drawable will be drawn on that layer instead of the parent entity's render layer. Drawables set in this way are retained between script ticks and must be cleared manually using localAnimator.clearDrawables().

The drawable object must specify exactly one of the following keys to define its type:

The following additional keys may be specified for any drawable type:

The following additional key may be specified for line drawables:

The following transformation options may be specified for image drawables. Note that if a transformation is specified, it will be used instead of other specific transformation operations.


void localAnimator.clearDrawables()

Clears the list of drawables to be rendered.


void localAnimator.addLightSource(Json lightSource)

Adds the specified light source to the animator's list of light sources to be rendered. Light sources set in this way are retained between script ticks and must be cleared manually using localAnimator.clearLightSources(). The configuration object for the light source accepts the following keys:


void localAnimator.clearLightSources()

Clears the list of light sources to be rendered.