IAnimation interface
The IAnimation
interface represents an animation within an animated object type. This is only applicable to animated plugins such as Sprite.
Methods
- GetName()
- Return a string of the animation name.
- GetObjectType()
- Return the IObjectType that this animation belongs to.
- GetFrames()
- 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.
- SetSpeed(s)
- GetSpeed()
- Set and get the animation speed in animation frames per second.
- SetLooping(l)
- IsLooping()
- Set and get the looping flag for the animation, indicating if the animation will repeat.
- SetPingPong(p)
- IsPingPong()
- Set and get the ping-pong flag for the animation, indicating if the animation will repeat alternating forwards and backwards.
- SetRepeatCount(r)
- GetRepeatCount()
- Set and get the number of times the animation is set to repeat.
- SetRepeatTo(f)
- GetRepeatTo()
- Set and get the animation frame index to return to when repeating the animation. This must be a valid index.
- Delete()
- Immediately deletes this animation from its object without any confirmation prompt. This cannot be undone.
Addon SDK Manual
Construct.net
2018-01-08
2024-02-15
You are here:
Search this manual:
This manual entry was last updated on 15 Feb, 2024 at 15:13