CAPH.WUI.ANI.ROTATEANIMATION
RotateAnimation represents a class that provides rotate effect for widgets. This is one of the six basic types of animation.
Constructor
RotateAnimation | ||
Description | ||
Construct a RotateAnimation | ||
Parameters | ||
obj | Object | A widget created by user. |
option | Object | The option include below properties * x : (Number) indicates the multiples along x-axis of the scale transformation of widget after animation. * y : (Number) indicates the multiples along y-axis of the scale transformation of widget after animation. , z {Number}: indicates the multiples along z-axis of the scale transformation of widget after animation. , ease {String}: describes the motion tween of the batch of animations, it could be set as one of the values below - 'SineCubic.InOut'. 'Linear.None', if user don't set ease, this is default. 'Quadratic.In', 'Quadratic.Out', 'Quadratic.InOut', 'Cubic.In', 'Cubic.Out', 'Cubic.InOut', 'Quartic.In', 'Quartic.Out', 'Quartic.InOut', 'Quintic.In', 'Quintic.Out', 'Quintic.InOut', 'Sinusoidal.In', 'Sinusoidal.Out', 'Sinusoidal.InOut', 'Exponential.In', 'Exponential.Out', 'Exponential.InOut', 'Circular.In', 'Circular.Out', 'Circular.InOut', 'Elastic.In', 'Elastic.Out', 'Elastic.InOut', 'Back.In', 'Back.Out', 'Back.InOut', 'Bounce.In', 'Bounce.Out', 'Bounce.InOut' * duration : (Number) describes how long the batch of animations to be performed in the meanwhile would last, the unit is millisecond(ms). - [default : 1000] * delay : (Number) describes the time duration of the batch of animations would defer starting, the unit is millisecond(ms)} |
Emulator Support | Y | |
SDK Constraint | None | |
Example | ||
var RotateAnimation = caph.wui.ani.RotateAnimation; var AniLoader = caph.wui.ani.AniLoader; var Box = caph.wui.widget.Box; var UIContext = caph.wui.widget.UIContext; var rotate = new RotateAnimation(); var loader = new AniLoader(); var uiContext = new UIContext(); var widget = new Box(); widget.render(uiContext); var rotateOpt = {y: Math.PI / 2, duration: 2000}; rotate.add(widget, rotateOpt); loader.add(rotate); loader.start(uiContext); |
Methods
RotateAnimation | ||
Description | ||
(Constructor) Construct a RotateAnimation | ||
Parameters | ■obj - Object - A widget created by user. ■option (Optional) - Object - The option include below properties * x : (Number) indicates the multiples along x-axis of the scale transformation of widget after animation. * y : (Number) indicates the multiples along y-axis of the scale transformation of widget after animation. , z {Number}: indicates the multiples along z-axis of the scale transformation of widget after animation. , ease {String}: describes the motion tween of the batch of animations, it could be set as one of the values below - 'SineCubic.InOut'. 'Linear.None', if user don't set ease, this is default. 'Quadratic.In', 'Quadratic.Out', 'Quadratic.InOut', 'Cubic.In', 'Cubic.Out', 'Cubic.InOut', 'Quartic.In', 'Quartic.Out', 'Quartic.InOut', 'Quintic.In', 'Quintic.Out', 'Quintic.InOut', 'Sinusoidal.In', 'Sinusoidal.Out', 'Sinusoidal.InOut', 'Exponential.In', 'Exponential.Out', 'Exponential.InOut', 'Circular.In', 'Circular.Out', 'Circular.InOut', 'Elastic.In', 'Elastic.Out', 'Elastic.InOut', 'Back.In', 'Back.Out', 'Back.InOut', 'Bounce.In', 'Bounce.Out', 'Bounce.InOut' * duration : (Number) describes how long the batch of animations to be performed in the meanwhile would last, the unit is millisecond(ms). - [default : 1000] * delay : (Number) describes the time duration of the batch of animations would defer starting, the unit is millisecond(ms)} | |
Return | ■Void | |
Emulator Support | Y | |
SDK Constraint | none | |
Example | ||
var RotateAnimation = caph.wui.ani.RotateAnimation; var AniLoader = caph.wui.ani.AniLoader; var Box = caph.wui.widget.Box; var UIContext = caph.wui.widget.UIContext; var rotate = new RotateAnimation(); var loader = new AniLoader(); var uiContext = new UIContext(); var widget = new Box(); widget.render(uiContext); var rotateOpt = {y: Math.PI / 2, duration: 2000}; rotate.add(widget, rotateOpt); loader.add(rotate); loader.start(uiContext); |
remove | ||
Description | ||
Removes all the arguments that needed for animation on the widget. | ||
Parameters | ■obj - Object - An instance of widget created by user. | |
Return | ■Void | |
Emulator Support | Y | |
SDK Constraint | none | |
Example | ||
var RotateAnimation = caph.wui.ani.RotateAnimation; var AniLoader = caph.wui.ani.AniLoader; var Box = caph.wui.widget.Box; var UIContext = caph.wui.widget.UIContext; var rotate = new RotateAnimation(); var loader = new AniLoader(); var uiContext = new UIContext(); var widget = new Box(); widget.render(uiContext); var rotateOpt = {y: Math.PI / 2, duration: 2000}; rotate.add(widget, rotateOpt); rotate.remove(widget); |
getList | ||
Description | ||
Returns the array that contains widget-arguments pairs, here 'arguments' are the options needed for animation. | ||
Parameters | ■Void | |
Return | ■Array - The array of a object pairs,including widget and options of its' animation. | |
Emulator Support | Y | |
SDK Constraint | none | |
Example | ||
var RotateAnimation = caph.wui.ani.RotateAnimation; var AniLoader = caph.wui.ani.AniLoader; var Box = caph.wui.widget.Box; var UIContext = caph.wui.widget.UIContext; var rotate = new RotateAnimation(); var loader = new AniLoader(); var uiContext = new UIContext(); var widget = new Box(); widget.render(uiContext); var rotateOpt = {y: Math.PI / 2, duration: 2000}; rotate.add(widget, rotateOpt); var aniList = rotate.getList(); |
add | ||
Description | ||
Bind the options needed for rotate animation with user's widget. | ||
Parameters | ■obj - Object - A widget created by user. ■option (Optional) - Object - The option include below properties * x : (Number) indicates the multiples along x-axis of the scale transformation of widget after animation. * y : (Number) indicates the multiples along y-axis of the scale transformation of widget after animation. * z : (Number) indicates the multiples along z-axis of the scale transformation of widget after animation. * ease : (String) describes the motion tween of the batch of animations, it could be set as one of the values below - 'SineCubic.InOut'. 'Linear.None', if user don't set ease, this is default. 'Quadratic.In', 'Quadratic.Out', 'Quadratic.InOut', 'Cubic.In', 'Cubic.Out', 'Cubic.InOut', 'Quartic.In', 'Quartic.Out', 'Quartic.InOut', 'Quintic.In', 'Quintic.Out', 'Quintic.InOut', 'Sinusoidal.In', 'Sinusoidal.Out', 'Sinusoidal.InOut', 'Exponential.In', 'Exponential.Out', 'Exponential.InOut', 'Circular.In', 'Circular.Out', 'Circular.InOut', 'Elastic.In', 'Elastic.Out', 'Elastic.InOut', 'Back.In', 'Back.Out', 'Back.InOut', 'Bounce.In', 'Bounce.Out', 'Bounce.InOut' * duration : (Number) describes how long the batch of animations to be performed in the meanwhile would last, the unit is millisecond(ms) - [default : 1000] * delay : (Number) describes the time duration of the batch of animations would defer starting, the unit is millisecond(ms)} | |
Return | ■Void | |
Emulator Support | Y | |
SDK Constraint | none | |
Example | ||
var RotateAnimation = caph.wui.ani.RotateAnimation; var AniLoader = caph.wui.ani.AniLoader; var Box = caph.wui.widget.Box; var UIContext = caph.wui.widget.UIContext; var rotate = new RotateAnimation(); var loader = new AniLoader(); var uiContext = new UIContext(); var widget = new Box(); widget.render(uiContext); var rotateOpt = {y: Math.PI / 2, duration: 2000}; rotate.add(widget, rotateOpt); loader.add(rotate); loader.start(uiContext); |
clone | ||
Description | ||
Creates and returns clone object from current object, the cloned object will have the same properties and same methods with the current object. | ||
Parameters | ■Void | |
Return | ■Object - The cloned object. | |
Emulator Support | Y | |
SDK Constraint | none | |
Example | ||
var RotateAnimation = caph.wui.ani.RotateAnimation; var rotateObject =new RotateAnimation(); var obj = rotateObject.clone(); |
equals | ||
Description | ||
Compares the contents of two objects using strict equality, objects are considered equal if they both have the same set of properties and the values of those properties are equal. | ||
Parameters | ■Object - Object - The object which wants to compare with current object. | |
Return | ■Boolean - Indicates whether the two objects are equal, - true : if they are equal, return true. - false : if they aren't equal, return false. | |
Emulator Support | Y | |
SDK Constraint | none | |
Example | ||
var RotateAnimation = caph.wui.ani.RotateAnimation; var rotateObject =new RotateAnimation(); var obj = rotateObject.clone(); var isequal = rotateObject.equals(obj); |