2
* Copyright (C) 2014 National University of Defense Technology(NUDT) & Kylin Ltd.
5
* Zhang Chao zhangchao@ubuntukylin.com
7
* This program is free software; you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation; version 3.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program. If not, see <http://www.gnu.org/licenses/>.
21
Window.SetBackgroundTopColor (0, 0, 0);
22
Window.SetBackgroundBottomColor (0, 0, 0);
24
left_1_image = Image("left_1.png");
25
resized_left_1_image = left_1_image.Scale(Window.GetWidth(), Window.GetWidth()*left_1_image.GetHeight()/left_1_image.GetWidth());
26
left_1_sprite = Sprite();
27
left_1_sprite.SetImage(resized_left_1_image);
28
left_1_sprite.SetX(0);
29
left_1_sprite.SetY(Window.GetHeight() / 2 - resized_left_1_image.GetHeight() / 2);
30
left_1_sprite.SetZ(98);
31
left_1_sprite.SetOpacity(0);
33
left_2_image = Image("left_2.png");
34
resized_left_2_image = left_2_image.Scale(Window.GetWidth(), Window.GetWidth()*left_2_image.GetHeight()/left_2_image.GetWidth());
35
left_2_sprite = Sprite();
36
left_2_sprite.SetImage(resized_left_2_image);
37
left_2_sprite.SetX(0);
38
left_2_sprite.SetY(Window.GetHeight() / 2 - resized_left_2_image.GetHeight() / 2);
39
left_2_sprite.SetZ(98);
40
left_2_sprite.SetOpacity(1);
42
xx_h=resized_left_1_image.GetHeight()-50;
43
xx_y=Window.GetHeight() / 2 - xx_h / 2;
45
xx_w=resized_left_1_image.GetWidth()-200;
46
xx_x=Window.GetWidth() / 2 - xx_w / 2;
48
all_1_image = Image("all_1.png");
49
resized_all_1_image = all_1_image.Scale(Window.GetWidth(), Window.GetWidth()*all_1_image.GetHeight()/all_1_image.GetWidth());
50
all_1_sprite = Sprite();
51
all_1_sprite.SetImage(resized_all_1_image);
53
all_1_sprite.SetY(Window.GetHeight() / 2 - resized_all_1_image.GetHeight() / 2);
54
all_1_sprite.SetZ(102);
55
all_1_sprite.SetOpacity(0);
57
all_2_image = Image("all_2.png");
58
resized_all_2_image = all_2_image.Scale(Window.GetWidth(), Window.GetWidth()*all_2_image.GetHeight()/all_2_image.GetWidth());
59
all_2_sprite = Sprite();
60
all_2_sprite.SetImage(resized_all_2_image);
62
all_2_sprite.SetY(Window.GetHeight() / 2 - resized_all_2_image.GetHeight() / 2);
63
all_2_sprite.SetZ(103);
64
all_2_sprite.SetOpacity(0);
66
all1_1_image = Image("all1_1.png");
67
resized_all1_1_image = all1_1_image.Scale(Window.GetWidth(), Window.GetWidth()*all1_1_image.GetHeight()/all1_1_image.GetWidth());
68
all1_1_sprite = Sprite();
69
all1_1_sprite.SetImage(resized_all1_1_image);
70
all1_1_sprite.SetX(0);
71
all1_1_sprite.SetY(Window.GetHeight() / 2 - resized_all1_1_image.GetHeight() / 2);
72
all1_1_sprite.SetZ(101);
73
all1_1_sprite.SetOpacity(0);
75
all1_2_image = Image("all1_2.png");
76
resized_all1_2_image = all1_2_image.Scale(Window.GetWidth(), Window.GetWidth()*all1_2_image.GetHeight()/all1_2_image.GetWidth());
77
all1_2_sprite = Sprite();
78
all1_2_sprite.SetImage(resized_all1_2_image);
79
all1_2_sprite.SetX(0);
80
all1_2_sprite.SetY(Window.GetHeight() / 2 - resized_all1_2_image.GetHeight() / 2);
81
all1_2_sprite.SetZ(100);
82
all1_2_sprite.SetOpacity(0);
84
text_image = Image("text.png");
85
resized_text_image = text_image.Scale(Window.GetWidth(), Window.GetWidth()*text_image.GetHeight()/text_image.GetWidth());
86
text_sprite = Sprite();
87
text_sprite.SetImage(resized_text_image);
89
text_sprite.SetY(Window.GetHeight() / 2 - resized_text_image.GetHeight() / 2);
90
text_sprite.SetZ(106);
91
text_sprite.SetOpacity(0);
94
xx_image = Image("xx.png");
95
xx1_image = Image("xx1.png");
96
xx2_image = Image("xx2.png");
97
xx3_image = Image("xx3.png");
100
xx_sprite[i]=Sprite(xx_image);
101
xx_sprite[i].SetOpacity(0);
102
xx_sprite[i].SetZ(105);
103
xx1_sprite[i]=Sprite(xx1_image);
104
xx1_sprite[i].SetOpacity(0);
105
xx1_sprite[i].SetZ(105);
106
xx2_sprite[i]=Sprite(xx2_image);
107
xx2_sprite[i].SetOpacity(0);
108
xx2_sprite[i].SetZ(105);
109
xx3_sprite[i]=Sprite(xx3_image);
110
xx3_sprite[i].SetOpacity(0);
111
xx3_sprite[i].SetZ(105);
120
fun refresh_callback ()
122
# Currently we do nothing here
125
left_1_sprite.SetOpacity(Math.Sin(progress/50));
126
left_2_sprite.SetOpacity(1-Math.Sin(progress/50));
127
text_sprite.SetOpacity(progress/157);
129
left_1_sprite.SetOpacity(0);
130
left_2_sprite.SetOpacity(0);
133
all1_1_Opacity=(progress-50)%314;
134
all1_1_sprite.SetOpacity(Math.Sin(all1_1_Opacity/100));
137
all1_2_Opacity=progress%78;
138
all1_2_sprite.SetOpacity(Math.Sin(all1_2_Opacity/25));
141
all_1_Opacity=(progress-78)%157;
142
all_1_sprite.SetOpacity(Math.Sin(all_1_Opacity/50));
145
all_2_Opacity=progress%157;
146
all_2_sprite.SetOpacity(Math.Sin(all_2_Opacity/50));
152
if(star_progress < 800){
153
if(star_progress%40==0){
154
xx_sprite[star_progress/40].SetX(Math.Int(Math.Random(10)*xx_w+xx_x));
155
xx_sprite[star_progress/40].SetY(Math.Int(Math.Random(10)*xx_h+xx_y));
156
xx1_sprite[star_progress/40].SetX(Math.Int(Math.Random(10)*Window.GetWidth()));
157
xx1_sprite[star_progress/40].SetY(Math.Int(Math.Random(10)*Window.GetHeight()));
158
xx2_sprite[star_progress/40].SetX(Math.Int(Math.Random(10)*Window.GetWidth()));
159
xx2_sprite[star_progress/40].SetY(Math.Int(Math.Random(10)*Window.GetHeight()));
160
xx3_sprite[star_progress/40].SetX(Math.Int(Math.Random(10)*Window.GetWidth()));
161
xx3_sprite[star_progress/40].SetY(Math.Int(Math.Random(10)*Window.GetHeight()));
163
xx_sprite[Math.Int(star_progress/40)].SetOpacity((progress%40)/40);
164
xx1_sprite[Math.Int(star_progress/40)].SetOpacity((progress%40)/40);
165
xx2_sprite[Math.Int(star_progress/40)].SetOpacity((progress%40)/40);
166
xx3_sprite[Math.Int(star_progress/40)].SetOpacity((progress%40)/40);
168
if(star_progress%80 < 40){
169
xx_sprite[Math.Int(star_progress/80)% 20].SetOpacity(1-(progress%80)/40);
170
xx1_sprite[Math.Int(star_progress/80)% 20].SetOpacity(1-(progress%80)/40);
171
xx2_sprite[Math.Int(star_progress/80)% 20].SetOpacity(1-(progress%80)/40);
172
xx3_sprite[Math.Int(star_progress/80)% 20].SetOpacity(1-(progress%80)/40);
174
if(star_progress%80==40){
175
xx_sprite[Math.Int(star_progress/80)% 20].SetX(Math.Int(Math.Random(10)*xx_w+xx_x));
176
xx_sprite[Math.Int(star_progress/80)% 20].SetY(Math.Int(Math.Random(10)*xx_h+xx_y));
177
xx1_sprite[Math.Int(star_progress/80)% 20].SetX(Math.Int(Math.Random(10)*Window.GetWidth()));
178
xx1_sprite[Math.Int(star_progress/80)% 20].SetY(Math.Int(Math.Random(10)*Window.GetHeight()));
179
xx2_sprite[Math.Int(star_progress/80)% 20].SetX(Math.Int(Math.Random(10)*Window.GetWidth()));
180
xx2_sprite[Math.Int(star_progress/80)% 20].SetY(Math.Int(Math.Random(10)*Window.GetHeight()));
181
xx3_sprite[Math.Int(star_progress/80)% 20].SetX(Math.Int(Math.Random(10)*Window.GetWidth()));
182
xx3_sprite[Math.Int(star_progress/80)% 20].SetY(Math.Int(Math.Random(10)*Window.GetHeight()));
184
xx_sprite[Math.Int(star_progress/80)% 20].SetOpacity((progress%80)/40);
185
xx1_sprite[Math.Int(star_progress/80)% 20].SetOpacity((progress%80)/40);
186
xx2_sprite[Math.Int(star_progress/80)% 20].SetOpacity((progress%80)/40);
187
xx3_sprite[Math.Int(star_progress/80)% 20].SetOpacity((progress%80)/40);
196
Plymouth.SetRefreshFunction (refresh_callback);
200
#----------------------------------------- Progress Bar --------------------------------
203
fun progress_callback (duration, progress)
208
Plymouth.SetBootProgressFunction(progress_callback);
210
#----------------------------------------- Quit --------------------------------
216
Plymouth.SetQuitFunction(quit_callback);