Class: AnimationScripts

rune.animation.AnimationScripts()

The AnimationScripts class is a handler for executing program code as part of an animation sequence. Via this handler, a function call can be linked to a keyframe within the current animation. The function call is called when the keyframe is played back as part of the animation sequence.

Constructor

new AnimationScripts()

Creates a new AnimationScripts object.
Source:

Members

(readonly) length :number

Returns the number of scripts registered by the handler.
Type:
  • number
Source:

Methods

add(index, callback, scope) → {undefined}

Adds a new script to the current animation sequence. The script is added to a specific keyframe and there can only be one script per keyframe.
Parameters:
Name Type Description
index number Index of the keyframe to which the script is to be added.
callback function Reference to the function that represents the script.
scope Object Scope within which the script is executed.
Source:
Returns:
Type
undefined

remove(index) → {undefined}

Deletes a script from a keyframe.
Parameters:
Name Type Description
index number Index of the keyframe whose script is to be deleted.
Source:
Returns:
Type
undefined