Widget/API/SetAnimation

__NOTOC__
Sets the parameters needed for playing a texture animation.
MyTexture:SetAnimation(texImage, speed, framesPerWidth, index, numFrames);
== Parameters ==
=== Arguments ===
:;texImage
::string - Filename and path of texture to be used for animation.
:;speed
::number - Playback speed in frames per second.
:;framesPerWidth
::number - Number of animation frames spanning the width of the image file.
:;index
::number - Frame index to start animation from.
:;numFrames
::number - Number of frames to play for this animation. 
=== Returns ===
:;None
== Example ==
texture:SetAnimation("interface/addons/cn/emotion/6.tga", 3, 8, 56, 7);
== Notes ==
It seems only one texture can be specified for an animation, so only small animations can be created.
The frame index always starts at 0 from the top left corner of the image, and increases by one from left to right, top to bottom.
The framesPerWidth parameter is a divisor for the texture. All animation frames are square, so the height of the texture is also divided by this value to arrive at the number of animation frames on the texture.
== Related Pages ==
* Widget (Overview)
Category:Widget/API Category:Widget/Class/Texture