Actor's Transformation API Cleanup
[platform/core/uifw/dali-demo.git] / resources / scripts / animation.json
1 /*
2  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17 {
18   // library of styles
19   "styles": {
20     "red-theme": {
21       "color": [1, 0, 0, 1]
22     },
23     "basic-text": {
24       "parent-origin": "CENTER"
25     }
26   },
27   "paths":
28   {
29     "path0":
30     {
31       "points":[ [-150, -50, 0], [0.0,70.0,0.0], [190.0,-150.0,0.0] ],
32       "curvature":0.35
33     }
34   },
35   // library of animations
36   "animations": {
37     "animate": {
38       "duration": 10.0,
39       "properties": [{
40         "actor": "greeting", // referenced actors must exist on stage
41         "property": "position",
42         "value": [300, 300, -1000],
43         "alpha-function": "EASE_IN_OUT",
44         "time-period": {
45           "delay": 0,
46           "duration": 3
47         }
48       }, {
49         "actor": "greeting", // referenced actors must exist on stage
50         "property": "scale",
51         "value": [5, 5, 1],
52         "time-period": {
53           "delay": 2,
54           "duration": 3
55         }
56       }]
57     },
58     "rotate": {
59       "duration": 10.0,
60       "properties": [{
61         "actor": "image", // referenced actors must exist on stage
62         "property": "orientation",
63         "value": [0, 0, -45],
64         "alpha-function": "EASE_IN_OUT",
65         "time-period": {
66           "delay": 0,
67           "duration": 3
68         }
69       }]
70     },
71     "path-animation": {
72       "duration": 3.0,
73       "properties": [{
74         "actor": "greeting2", // referenced actors must exist on stage
75         "path":"path0",
76         "forward":[1,0,0],
77         "alpha-function": "EASE_IN_OUT",
78         "time-period": {
79           "delay": 0,
80           "duration": 3
81         }
82       }]
83     }
84   },
85   // a tree of actors
86   "stage": [{
87     "name": "greeting",
88     "type": "TextView",
89     "text": "Touch me",
90     "styles": ["basic-text"],
91     "position": [0, -120, 0],
92     "size": [200, 200, 1],
93     "orientation": [0, 0, 30],
94     "signals": [{
95       "name": "touched",
96       "action": "play",
97       "animation": "animate"
98     }]
99   }, {
100     "name":"greeting2",
101     "type": "TextView",
102     "parent-origin": "CENTER",
103     "anchor-point": "CENTER",
104     "size": [200, 200, 1],
105     "orientation": [0, 0, 39],
106     "position": [-150, -50, 0],
107     "text": "or me",
108     "signals": [{
109       "name": "touched",
110       "action": "play",
111       "animation": "path-animation"
112     }]
113   }, {
114     "type": "TextView", // styles can be additive
115     "parent-origin": "CENTER",
116     "anchor-point": "CENTER",
117     "size": [200, 200, 1],
118     "text": "or the image.."
119   }, {
120     "name": "image",
121     "type": "ImageActor",
122     "image": {
123       "filename": "{DALI_IMAGE_DIR}gallery-large-21.jpg"
124     },
125     "position": [0, 200, 0],
126     "size": [200, 200, 1],
127     "signals": [{
128       "name": "touched",
129       "action": "play",
130       "animation": "rotate"
131     }],
132     "position-inheritance": "DONT_INHERIT_POSITION"
133   }]
134 }