top

CAPH.WUI.ANI.FADEANIMATION

FadeAnimation represents a class that provides fade/show effect for widgets. This is one of the six basic types of animation.


Constructor

FadeAnimation

Description
Construct a new FadeAnimation object.
Parameters
obj Object A widget created by user.
option Object -The option include below properties * opacity : (Number) indicates the final opacity after animation, usable only for fade animation, the value range is [0, 1], both boundary values are valid. * 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 SupportY
SDK ConstraintNone
Example
var FadeAnimation = caph.wui.ani.FadeAnimation;
var AniLoader = caph.wui.ani.AniLoader;  
var Box  = caph.wui.widget.Box;   
var UIContext = caph.wui.widget.UIContext;

var fade = new FadeAnimation();
var loader = new AniLoader();
var uiContext   = new UIContext();
var widget = new Box();
widget.render(uiContext);

var fadeOpt = {opacity: 0.2, duration: 2000}; 
fade.add(widget, fadeOpt);

loader.add(fade);
loader.start(uiContext);

Methods

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 SupportY
SDK Constraintnone
Example
var FadeAnimation = caph.wui.ani.FadeAnimation;
var AniLoader = caph.wui.ani.AniLoader;  
var Box  = caph.wui.widget.Box;   
var UIContext = caph.wui.widget.UIContext;

var fade = new FadeAnimation();
var loader = new AniLoader();
var uiContext   = new UIContext();
var widget = new Box();
widget.render(uiContext);

fade.add(box, {
  'opacity': 0.9
});

loader.add(fade);
loader.start(uiContext);
var aniList = fade.getList();

FadeAnimation

Description
(Constructor) Construct a new FadeAnimation object.
Parameters
■obj
  - Object
  - A widget created by user.
■option (Optional)
  - Object 
  - The option include below properties
   * opacity : (Number) indicates the final opacity after animation, usable only for fade animation, the value range is [0, 1], both boundary values are valid. 
   * 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 SupportY
SDK Constraintnone
Example
var FadeAnimation = caph.wui.ani.FadeAnimation;
var AniLoader = caph.wui.ani.AniLoader;  
var Box  = caph.wui.widget.Box;   
var UIContext = caph.wui.widget.UIContext;

var fade = new FadeAnimation();
var loader = new AniLoader();
var uiContext   = new UIContext();
var widget = new Box();
widget.render(uiContext);

var fadeOpt = {opacity: 0.2, duration: 2000}; 
fade.add(widget, fadeOpt);

loader.add(fade);
loader.start(uiContext);

add

Description
Binds the options needed for fade animation with user's widget.
Parameters
■obj
  - Object
  - A widget created by user.       
■option (Optional)
  - Object 
  - The option include below properties
   * opacity : (Number) indicates the final opacity after animation, usable only for fade animation, the value range is [0, 1], both boundary values are valid.
   * 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 SupportY
SDK Constraintnone
Example
var FadeAnimation = caph.wui.ani.FadeAnimation;
var AniLoader = caph.wui.ani.AniLoader;  
var Box  = caph.wui.widget.Box;   
var UIContext = caph.wui.widget.UIContext;

var fade = new FadeAnimation();
var loader = new AniLoader();
var uiContext   = new UIContext();
var widget = new Box();
widget.render(uiContext);

var fadeOpt = {opacity: 0.2, duration: 2000}; 
fade.add(widget, fadeOpt);

loader.add(fade);
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 SupportY
SDK Constraintnone
Example
var FadeAnimation = caph.wui.ani.FadeAnimation;
var fade = new FadeAnimation();
var box = new Box();
fade.add(box, {
  'opacity': 0.9
});
fade.remove(box);

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 SupportY
SDK Constraintnone
Example
var FadeAnimation = caph.wui.ani.FadeAnimation;
var fade = new FadeAnimation();
var obj = fade.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 SupportY
SDK Constraintnone
Example
var FadeAnimation = caph.wui.ani.FadeAnimation;
var fadeObject =new FadeAnimation();
var obj = fadeObject.clone();
var isequal = fadeObject.equals(obj);