1
# ubuntukylin-logo.script - boot splash plugin
3
# Copyright (C) 2009 Canonical Ltd.
4
# Copyright (C) 2013 ~ 2014 National University of Defense Technology(NUDT) & Kylin Ltd.
5
# This program is free software; you can redistribute it and/or modify
6
# it under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; either version 2, or (at your option)
10
# This program is distributed in the hope that it will be useful,
11
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
# GNU General Public License for more details.
15
logo.image = Image("customBG.png");
17
logo.screen_x = Window.GetWidth();
18
logo.screen_y = Window.GetHeight();
19
logo.image_x = logo.image.GetWidth();
20
logo.image_y = logo.image.GetHeight();
22
logo.scale_factor_x = Window.GetWidth() / logo.image.GetWidth();
23
logo.scale_factor_y = Window.GetHeight() / logo.image.GetHeight();
25
if(logo.scale_factor_x >= 1 && logo.scale_factor_y >= 1){
26
logo.scale_factor = 1;
29
if(logo.scale_factor_x > logo.scale_factor_y){
30
logo.scale_factor = logo.scale_factor_y;
33
logo.scale_factor = logo.scale_factor_x;
37
logo.scaled_image = logo.image.Scale(logo.image.GetWidth() * logo.scale_factor,
38
logo.image.GetHeight() * logo.scale_factor);
40
logo.sprite = Sprite(logo.scaled_image);
42
logo.sprite.SetX(Window.GetWidth() / 2 - logo.scaled_image.GetWidth () / 2);
43
logo.sprite.SetY(Window.GetHeight() / 2 - logo.scaled_image.GetHeight() / 2);
44
logo.sprite.SetZ(-10000);