Changes after TouchedSignal changes
[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     "redTheme": {
21       "color": [1, 0, 0, 1]
22     },
23     "basicText": {
24       "parentOrigin": "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         "alphaFunction": "EASE_IN_OUT",
44         "timePeriod": {
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         "timePeriod": {
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         "alphaFunction": "EASE_IN_OUT",
65         "timePeriod": {
66           "delay": 0,
67           "duration": 3
68         }
69       }]
70     },
71     "pathAnimation": {
72       "duration": 3.0,
73       "properties": [{
74         "actor": "greeting2", // referenced actors must exist on stage
75         "path":"path0",
76         "forward":[1,0,0],
77         "alphaFunction": "EASE_IN_OUT",
78         "timePeriod": {
79           "delay": 0,
80           "duration": 3
81         }
82       }]
83     }
84   },
85   // a tree of actors
86   "stage": [{
87     "name": "greeting",
88     "type": "TextLabel",
89     "text": "Touch me",
90     "styles": ["basicText"],
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": "TextLabel",
102     "parentOrigin": "CENTER",
103     "anchorPoint": "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": "pathAnimation"
112     }]
113   }, {
114     "type": "TextLabel", // styles can be additive
115     "parentOrigin": "CENTER",
116     "anchorPoint": "CENTER",
117     "size": [200, 200, 1],
118     "text": "or the image.."
119   }, {
120     "name": "image",
121     "type": "ImageView",
122     "image": "{DEMO_IMAGE_DIR}gallery-large-21.jpg",
123     "relayoutEnabled": false,
124     "position": [0, 200, 0],
125     "size": [200, 200, 1],
126     "signals": [{
127       "name": "touched",
128       "action": "play",
129       "animation": "rotate"
130     }],
131     "positionInheritance": "DONT_INHERIT_POSITION"
132   }]
133 }