8.2 – Texture Animation

Not available in iGUI Basic.
Texture animation feature can be used to animate GUI elements. It’s implemented to meet basic texture animation requirements. You can animate any texture property of the attached iGUIElement. You can easily add a texture animation to an element by right clicking on the inspector and selecting “Add texture animation”.

You’ll notice that an iGUI Texture Animation component will be automatically added to the element. First you have to select the Target property that decides which texture field will be animated. Then add some textures to images array and set the frames per second field.

When loop type is set to :

* Pause: The animation will play and pause at the last frame after the animation is complete.
* Pause and rewind: The animation will play and pause at the first frame after the animation is complete.
* Stop : The animation will play and will revert to the original image (not an animation frame) after the animation is complete.
* Loop : The animation will play and loop.

Now you can give a name to the animation to access later from code. You can access an animation of button1 with name “animation1″ by :


public void button1_Click(iGUIButton caller){
    iGUITextureAnimation myAnimation =  button1.getTextureAnimation("animation1");
    myAnimation.playFromStart();
}
function button1_Click(caller : iGUIButton){
    var myAnimation = button1.getTextureAnimation("animation1");
    myAnimation.playFromStart();
}