Merge "Fix for multi-language support." into tizen
[platform/core/uifw/dali-toolkit.git] / plugins / dali-script-v8 / docs / content / path-animation.js
1 /**
2  *
3 ## Path Animation API
4
5 Paths can be used to animate position and orientation of actors.
6
7 <img src="../assets/img/path.png"/>
8   
9 Example
10
11 ```
12 log("Path animation test\n");
13   
14 var point0 = [ 0.0, 80.0, 0.0 ];
15 var point1 = [ 200.0, 200.0, 0.0 ];
16 var point2 = [ 400.0, 80.0, 0.0 ];
17   
18 //Create a path
19 var myPath = new dali.Path();
20 myPath.points = [ point0, point1, point2 ];
21 myPath.generateControlPoints( 0.25 );
22   
23 function begin()
24 {
25   
26   var image = new dali.ResourceImage( {url:"gallery-small-45.jpg"} );
27   
28   var actor = new dali.ImageActor(image);
29   
30   actor.position = [100,100,0];
31   dali.stage.add( actor );
32   
33   var animation = new dali.Animation(2.0);
34   var animOptions = { alpha:"easeInOutSine", delay:0.5, duration:1.5 };
35   var forward = new dali.Vector3(1,0,0);
36   animation.animate( actor, myPath, forward, animOptions );
37   
38   animation.setLooping( true );
39   animation.play();
40 }
41   
42 begin();
43 ```
44 @class Path
45
46 */