XWidgetSoft Forum https://www.bbs.xwidget.com/ |
|
Animation Function Introduction https://www.bbs.xwidget.com/viewtopic.php?f=10&t=3667 |
Page 1 of 1 |
Author: | qiancang [ October 20th, 2013, 3:45 am ] |
Post subject: | Animation Function Introduction |
This post will include 4 animation functions: animatefloat(),moveto(),rotateto() and scaleto(). animatefloat() this function is the most basic animation function, you can use it to change one property of a component with. Code: image1.animatefloat(property name,new value,duration,occasion,dynamic effect,delay,hide) example: Code: image1.animatefloat("left",0,0.5,0.3,0,0,0,false); text1.animatefloat("rotateangle",180,1) property name: the property you want to change, such as "width","height","left","top","rotateangle" new value: new value of the porperty, data type:int duration: the duration of animation, unite:second occasion: the occasion to use dynamic effect, data type:int,0~2.
delay: the time to delay code execution, [data type:float]. [unite:second].
moveto() this function is used to change component position. Code: image1.moveto(left,top,duration,occasion,dynamic effect,delay,hide) example: Code: image1.moveto(100,30,0.5,0.3,0,0,0,false); //equals to image1.animatefloat("left",100,0.5,0.3,0,0,0,false); // image1.animatefloat("top",30,0.5,0.3,0,0,0,false); text1.moveto(text1.left,80,1); //equals to text1.animatefloat("top",80,1); left: the left position top: the top position duration: the duration of animation, unite:second occasion: the occasion to use dynamic effect, data type:int,0~2.
delay: the time to delay code execution, [data type:float]. [unite:second].
rotateto() this function is used to change component rotateangle. Code: image1.rotateto(new rotateAngle,duration,occasion,dynamic effect,delay,hide) example: Code: image1.rotateto(30,0.5,0.3,0,0,0,false); //equals to image1.animatefloat("rotateangle",30,0.5,0.3,0,0,0,false); text1.rotateto(80,1); //equals to text1.animatefloat("rotateangle",80,1); new rotateAngele: unite:degree range:minus infinity to positive infinity duration: the duration of animation, unite:second occasion: the occasion to use dynamic effect, data type:int,0~2.
delay: the time to delay code execution, [data type:float]. [unite:second].
scaleto() this function is used to scale component. you can not use animatefloat() to reach the same effect. Code: image1.scaleto(x scale ratio,y scale ratio,direction,duration,occasion,dynamic effect,delay,hide) example: Code: image1.scaleto(0.51,0.51,"bottom",0.3,0,0,0,false); text1.scaleto(3.5,text1.scale.y,"top",1); x scale ratio: data type:float,0.00~6.00 1.00 means the real size. y scale ratio: data type:float,0.00~6.00 1.00 means the real size. direction: such as "bottom","top","center","left" and "right" duration: the duration of animation, unite:second occasion: the occasion to use dynamic effect, data type:int,0~2.
delay: the time to delay code execution, [data type:float]. [unite:second].
|
Page 1 of 1 | All times are UTC - 8 hours |
Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |