- worker.get_time(id)
Gets the current progress of the animation.
- Arguments:
id (number) – The identifier for the animation.
- Returns:
number – - The current progress value of the animation.
- worker.set_delta_t(id, val)
Sets the current progress of an animation and updates the delta t value accordingly.
- Arguments:
id (number) – The identifier for the animation.
val (number) – The new progress value for the animation.
- worker.get_step(id)
Gets the current step of the animation.
- Arguments:
id (number) – The identifier for the animation.
- Returns:
number – - The current step value of the animation.
- worker.set_step(id, val)
Sets the current step of an animation. If the provided step value exceeds the maximum length of the animation, it will be set to the maximum length.
- Arguments:
id (number) – The identifier for the animation.
val (number) – The desired step value for the animation.
- worker.is_active(id)
Checks if an animation is currently running.
- Arguments:
id (number) – The identifier for the animation.
- Returns:
boolean – - true if the animation is currently running, false otherwise.
- worker.get_active(id)
Retrieves an array of all active animation identifiers.
- Returns:
Array.<number> – - An array of active animation identifiers.
- worker.start_animations(indices)
starts a list of animations
- Arguments:
indices (Array.<number>) – an array of ids of the animations to start
- worker.stop_animations(indices)
stops a list of animations
- Arguments:
indices (Array.<number>|string) – an array of ids of the animations to stop; if “all”, stops all animations
- worker.setLerp(index, step, value)
Sets a Lerp target value for a certain step of an animation.
- Arguments:
index (number) – the index of the animation
step (number) – the step for which the value should be set
value (number) – the value to set
- worker.setMatrix(index, step, value)
Sets the matrix lerp target value for a certain step of an animation.
- Arguments:
index (number) – the index of the animation
step (number) – the step for which the value should be set
value (Array.<number>) – the matrix to set. The matrix is a 1 dimensional array of floats with a length that is a multiple of 4 (e.g. [r1, g1, b1, a1, r2, g2, b2, a2])
- worker.get_lerp_value(id)
Gets the lerp result value of an animation.
- Arguments:
id (number) – The identifier for the animation.
- Returns:
number – - The lerp result value of the animation.
- worker.soft_reset(id)
Starts and resets an animation if its finished, or not playing.
- Arguments:
id (number) – The identifier for the animation.
- worker.hard_reset(id)
Starts and resets an animation.
- Arguments:
id (number) – The identifier for the animation.
- worker.get_duration(id)
Gets the duration of an animation.
- Arguments:
id (number) – The identifier for the animation.
- Returns:
number – - The duration of the animation.
- worker.set_duration(id, val)
Sets the duration of an animation.
- Arguments:
id (number) – The identifier for the animation.
val (number) – The desired duration value for the animation.
- worker.set_sequence_length(id, val)
Sets the sequence length of an animation.
- Arguments:
id (number) – The identifier for the animation.
val (number) – The desired sequence length for the animation.
- worker.change_framerate(fps_new)
Changes the framerate of the animation loop.
- Arguments:
fps_new (number) – The new framerate in frames per second.
- worker.get_constant(id, type)
Gets a constant value.
- Arguments:
id (number) – the id of the constant
type (string) – the type of the constant (number or matrix)
- Returns:
number|Array.<number> – value - the value of the constant
- worker.get_constant_number(id)
Retrieves a constant number value by its identifier.
- Arguments:
id (number) – The identifier for the constant number.
- Returns:
number – - The constant number value associated with the given identifier.
- worker.get_constant_row(id, row)
Retrieves a specific row from a matrix constant.
- Arguments:
id (number) – The identifier for the matrix constant.
row (number) – The index of the row to retrieve from the matrix constant.
- Returns:
Array – - The specified row from the matrix constant.
- worker.render_constant(id, type)
This function can be called by the worker when a constant value is changed. The main thread will receive a message with the changed value.
- Arguments:
id (number) – the id of the constant
type (number) – the type of the constant (0 = number, 1 = matrix)
- worker.update_constant(id, type, value)
Updates a constant value.
- Arguments:
id (number) – the id of the constant to update
type (string) – the type of the constant (number or matrix)
value (number|Array.<number>) – the new value of the constant
- worker.set_delay(id, val)
Sets the delay of an animation.
- Arguments:
id (number) – The identifier for the animation.
val (number) – The desired delay value for the animation.
- get_delay(id)
Retrieves the delay of an animation.
- Arguments:
id (number) – The identifier for the animation.
- Returns:
number – - The delay value of the animation.
- worker.get_delay_delta(id)
Retrieves the current delay progress value of an animation.
- Arguments:
id (number) – The identifier for the animation.
- Returns:
number – - The current delay progress value of the animation.
- worker.set_delay_delta(id, val)
Sets the current delay progress value for an animation.
- Arguments:
id (number) – The identifier for the animation.
val (number) – The desired delay progress value for the animation.
- worker.lambda_call(id, args)
Calls a lambda function stored in callback_map with the given id and arguments.
- Arguments:
id (number) – The id of the lambda function to call
args (Array.<any>) – The arguments to pass to the lambda function