IAnimation interface represents an animation within an animated object type. This is only applicable to animated plugins such as Sprite.
- Return the IObjectType that this animation belongs to.
- Return an array of IAnimationFrame representing the frames in this animation.
- AddFrame(blob, width, height)
- Add a new animation frame to the animation. All the parameters are optional. There are four overloads of this method:
- No parameters passed: add an empty animation frame with a default size
- Blob passed with no size: use the blob as the animation frame image file, and decompress the image to determine the size
- Blob passed with size: use the blob as the animation frame image file and use the provided size (which must be correct) to skip having to decompress the image to find its size
- No blob passed but size provided: use the size for the empty animation frame
The method returns a promise that resolves with the added IAnimationFrame.
- Set and get the animation speed in animation frames per second.
- Set and get the looping flag for the animation, indicating if the animation will repeat.
- Set and get the ping-pong flag for the animation, indicating if the animation will repeat alternating forwards and backwards.
- Set and get the number of times the animation is set to repeat.
- Set and get the animation frame index to return to when repeating the animation. This must be a valid index.
- Immediately deletes this animation from its object without any confirmation prompt. This cannot be undone.
Addon SDK Manual
You are here:
Search this manual:
This manual entry was last updated on 16 Nov, 2020 at 16:56