DALi Version 1.4.27
[platform/core/uifw/dali-demo.git] / resources / scripts / background.json
1 /*
2  * Copyright (c) 2016 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   "stage": [
19     // A TextLabel with a color background
20     {
21       "type": "TextLabel",
22       "drawMode": "OVERLAY_2D",
23       "text": "Hello World",
24       "parentOrigin": "TOP_LEFT",
25       "anchorPoint": "TOP_LEFT",
26       "pointSize": 20,
27       "horizontalAlignment": "CENTER",
28       "verticalAlignment": "CENTER",
29       "widthResizePolicy":"SIZE_RELATIVE_TO_PARENT",
30       "heightResizePolicy":"SIZE_RELATIVE_TO_PARENT",
31       "sizeModeFactor": [ 0.5, 0.333333333333, 1 ],
32       "background":{
33         "visualType": "COLOR",
34         "mixColor": [ 0.8, 0, 0.2, 1 ]
35        }
36     },
37
38     // A control with an SVG image
39     {
40       "type": "Control",
41       "relayoutEnabled": false,
42       "parentOrigin": "TOP_RIGHT",
43       "anchorPoint": "TOP_RIGHT",
44       "widthResizePolicy":"SIZE_RELATIVE_TO_PARENT",
45       "heightResizePolicy":"SIZE_RELATIVE_TO_PARENT",
46       "sizeModeFactor": [ 0.5, 0.333333333333, 1 ],
47       "background": {
48         "visualType": "IMAGE",
49         "url": "{DEMO_IMAGE_DIR}Kid1.svg"
50       }
51     },
52
53     // A control with a border
54     {
55       "type": "Control",
56       "relayoutEnabled": false,
57       "parentOrigin": "CENTER_LEFT",
58       "anchorPoint": "CENTER_LEFT",
59       "widthResizePolicy":"SIZE_RELATIVE_TO_PARENT",
60       "heightResizePolicy":"SIZE_RELATIVE_TO_PARENT",
61       "sizeModeFactor": [ 0.5, 0.333333333333, 1 ],
62       "background": {
63         "visualType" : "BORDER",
64         "borderColor" : [ 0.5, 0.5, 0.5, 1 ],
65         "borderSize" : 15.0
66       }
67     },
68
69     // A control with a JPG image
70     {
71       "type": "Control",
72       "relayoutEnabled": false,
73       "parentOrigin": "CENTER_RIGHT",
74       "anchorPoint": "CENTER_RIGHT",
75       "widthResizePolicy":"SIZE_RELATIVE_TO_PARENT",
76       "heightResizePolicy":"SIZE_RELATIVE_TO_PARENT",
77       "sizeModeFactor": [ 0.5, 0.333333333333, 1 ],
78       "background": {
79         "visualType": "IMAGE",
80         "url": "{DEMO_IMAGE_DIR}gallery-large-9.jpg"
81       }
82     },
83
84     // A control with a yellow background
85     {
86       "type": "Control",
87       "relayoutEnabled": false,
88       "parentOrigin": "BOTTOM_LEFT",
89       "anchorPoint": "BOTTOM_LEFT",
90       "widthResizePolicy":"SIZE_RELATIVE_TO_PARENT",
91       "heightResizePolicy":"SIZE_RELATIVE_TO_PARENT",
92       "sizeModeFactor": [ 0.5, 0.333333333333, 1 ],
93       "background":{
94         "visualType": "COLOR",
95         "mixColor": [ 1, 1, 0, 1 ]
96       }
97     },
98
99     // A control with a gradient
100     {
101       "type": "Control",
102       "relayoutEnabled": false,
103       "parentOrigin": "BOTTOM_RIGHT",
104       "anchorPoint": "BOTTOM_RIGHT",
105       "widthResizePolicy":"SIZE_RELATIVE_TO_PARENT",
106       "heightResizePolicy":"SIZE_RELATIVE_TO_PARENT",
107       "sizeModeFactor": [ 0.5, 0.333333333333, 1 ],
108       "background": {
109         "visualType" : "GRADIENT",
110         "startPosition" : [ -0.5, -0.5 ],
111         "endPosition": [ 0.5, 0.5 ],
112         "stopColor" : [
113           [ 1.0, 0.0, 0.0, 1.0 ],
114           [ 1.0, 0.25, 0.0, 1.0 ],
115           [ 1.0, 0.5, 0.0, 1.0 ],
116           [ 1.0, 0.75, 0.0, 1.0 ],
117           [ 1.0, 1.0, 0.0, 1.0 ]
118         ],
119         "stopOffset" : [ 0, 0.25, 0.5, 0.75, 1.0 ]
120        }
121     }
122   ]
123 }