# Two.ImageSequence
Extends: Two.Rectangle
A convenient package to display still or animated images organized as a series of still images.
# Constructor
Argument | Description |
---|---|
paths | A list of URLs or Two.Textures. |
ox | The initial x position of the Two.ImageSequence. |
oy | The initial y position of the Two.ImageSequence. |
frameRate | The frame rate at which the images should playback at. |
# DefaultFrameRate
Two.ImageSequence.DefaultFrameRate
default frame rate that Two.ImageSequence.frameRate is set to when instantiated.
# fromObject
Two.ImageSequence.fromObject
Returns: Two.ImageSequence
Argument | Description |
---|---|
obj | Object notation of a Two.ImageSequence to create a new instance |
Create a new Two.ImageSequence from an object notation of a Two.ImageSequence.
# textures
Two.ImageSequence.textures
A list of textures to be used as frames for animating the Two.ImageSequence.
# index
Two.ImageSequence.index
The index of the current tile of the sprite to display. Defaults to 0
.
# copy
Two.ImageSequence.copy
Argument | Description |
---|---|
imageSequence | The reference Two.ImageSequence |
Copy the properties of one Two.ImageSequence onto another.
# play
Two.ImageSequence.play
Argument | Description |
---|---|
firstFrame | The index of the frame to start the animation with. |
lastFrame | The index of the frame to end the animation with. Defaults to the last item in the Two.ImageSequence.textures. |
onLastFrame | Optional callback function to be triggered after playing the last frame. This fires multiple times when the image sequence is looped. |
Initiate animation playback of a Two.ImageSequence.
# stop
Two.ImageSequence.stop
Halt animation playback of a Two.ImageSequence and set the current frame back to the first frame.
# clone
Two.ImageSequence.clone
Returns: Two.ImageSequence
Argument | Description |
---|---|
parent | The parent group or scene to add the clone to. |
Create a new instance of Two.ImageSequence with the same properties of the current image sequence.
# toObject
Two.ImageSequence.toObject
Returns: Object
Return a JSON compatible plain object that represents the path.
# dispose
Two.ImageSequence.dispose
Returns: Two.ImageSequence
Release the image sequence's renderer resources and detach all events. This method stops any running animation, clears animation callbacks, unbinds textures collection events, and disposes individual textures (calling dispose() for thorough cleanup) while preserving the renderer type for potential re-attachment to a new renderer.