您的位置:首页 > 移动开发 > Unity3D

unity3d——iGUI实现图片动画

2013-08-17 16:47 561 查看


图片动画

注意: iGUI Basic.版本不能使用。

如图:创建一个IGUIImahe元素,然后于监视面板中,在该组件的icon的地方,右键选择“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 :

C#

JS

public void button1_Click(iGUIButton
caller){

iGUITextureAnimation myAnimation = button1.getTextureAnimation("animation1");

myAnimation.playFromStart();

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: