Commit 45b5febd authored by Anton V. Boyarshinov's avatar Anton V. Boyarshinov

updated bootsplash

parent 23edf303
bootsplash/progress_bar.png

261 Bytes | W: | H:

bootsplash/progress_bar.png

173 Bytes | W: | H:

bootsplash/progress_bar.png
bootsplash/progress_bar.png
bootsplash/progress_bar.png
bootsplash/progress_bar.png
  • 2-up
  • Swipe
  • Onion skin
# ALT Education Theme # Centaurus theme
fun imgscale( image, scale ) fun imgscale( image, scale )
{ {
...@@ -11,14 +11,7 @@ fun imgscale2( image, scaleX, scaleY ) ...@@ -11,14 +11,7 @@ fun imgscale2( image, scaleX, scaleY )
} }
# background # background
if( Window.GetWidth()/Window.GetHeight() > 1.5 ) logo.raw = Image("background16x9.png");
{
logo.raw = Image("background16x9.png");
}
else
{
logo.raw = Image("background4x3.png");
}
logo.image = imgscale2( logo.raw, logo.image = imgscale2( logo.raw,
Window.GetWidth()/logo.raw.GetWidth(), Window.GetWidth()/logo.raw.GetWidth(),
...@@ -110,44 +103,61 @@ fun display_password_callback (prompt, bullets) ...@@ -110,44 +103,61 @@ fun display_password_callback (prompt, bullets)
Plymouth.SetDisplayNormalFunction(display_normal_callback); Plymouth.SetDisplayNormalFunction(display_normal_callback);
Plymouth.SetDisplayPasswordFunction(display_password_callback); Plymouth.SetDisplayPasswordFunction(display_password_callback);
#------------------------------------- Progressbar ----------------------------- #----------------------------------------- Progress Bar --------------------------------
# Define bar size and position progress_box.raw = Image("progress_box.png");
bar_height = 36; scale_factor = Window.GetWidth() / progress_box.raw.GetWidth() * 0.8;
bar_x = Window.GetWidth() * 0.10; # 10% from left edge
bar_y = Window.GetHeight() / 2; # top progressbar edge should be at middle of screen
bar_width = Window.GetWidth() * 0.80; # 80% of screen width
# Progress background spite progress_box.image = imgscale( progress_box.raw, scale_factor );
progress_bg.raw = Image ("progress_bg.png");
progress_bg.image = imgscale2 (progress_bg.raw, bar_width, bar_height);
progress_bg.sprite = Sprite (progress_bg.image);
progress_bg.sprite.SetPosition (bar_x, bar_y);
progress_bg.sprite.SetZ (5);
# Progress bar sprite progress_box.sprite = Sprite(progress_box.image);
progress_bar.raw = Image ("progress_bar.png");
progress_bar.image = progress_bar.raw;
# Maximum number of sprites progress_box.x = Window.GetX() + Window.GetWidth() / 2 - progress_box.image.GetWidth() / 2;
steps = Math.Int (bar_width/18); progress_box.y = Window.GetY() + Window.GetHeight() / 2 - progress_box.image.GetHeight() / 2 + 50;
progress_box.sprite.SetPosition(progress_box.x, progress_box.y, 0);
# Show first step progress_bar.status.raw = Image("segment_status.png");
progress_bar.sprites[0] = Sprite (); progress_bar.runner = Sprite();
progress_bar.sprites[0].SetImage (progress_bar.image); progress_bar.runner.SetImage ( imgscale(progress_bar.status.raw, scale_factor));
progress_bar.sprites[0].SetPosition (bar_x, bar_y);
progress_bar.sprites[0].SetZ (10);
fun progress_callback (duration, progress)
progress_bar.x = Window.GetX() + Window.GetWidth() / 2 - progress_box.image.GetWidth() / 2;
progress_bar.y = Window.GetY() + Window.GetHeight() / 2 - progress_box.image.GetHeight() / 2 +
(progress_box.image.GetHeight() - progress_box.image.GetHeight()) / 2 + 50;
#Total steps
steps=33;
#left corner
progress_bar.l = imgscale( Image("segment_cornerL.png") , scale_factor );
progress_bar.spriteL = Sprite();
progress_bar.spriteL.SetImage (progress_bar.l);
progress_bar.spriteL.SetPosition(progress_bar.x,progress_bar.y, 2) ;
progress_bar.x += progress_bar.l.GetWidth()-1;
#middle
progress_bar.image = imgscale(Image("segment_middle.png"), scale_factor);
step = progress_bar.image.GetWidth()-1;
for( i=0; i<steps; i++ )
{ {
step = Math.Int ((progress+0.05) * steps) + 1; progress_bar.sprites[i] = Sprite();
if ( step > steps ) step = steps;
for( i=0; i<step; i++ ) {
progress_bar.sprites[i] = Sprite ();
progress_bar.sprites[i].SetImage (progress_bar.image); progress_bar.sprites[i].SetImage (progress_bar.image);
progress_bar.sprites[i].SetPosition (bar_x+i*18, bar_y); progress_bar.sprites[i].SetPosition(progress_bar.x+i*step,progress_bar.y, -1000) ;
progress_bar.sprites[i].SetZ (10); }
} #right corner
progress_bar.r = imgscale( Image("segment_cornerR.png") , scale_factor );
progress_bar.sprites[steps+1] = Sprite();
progress_bar.sprites[steps+1].SetImage (progress_bar.r);
progress_bar.sprites[steps+1].SetPosition(progress_bar.x+step*steps,progress_bar.y, -1000) ;
fun progress_callback (duration, progress)
{
for( i=0; i< progress*steps; i++ )
progress_bar.sprites[i].SetZ(2);
if( progress > 0.99 )
progress_bar.sprites[i+1].SetZ(2);
if( progress < 0.96 )
progress_bar.runner.SetPosition(progress_bar.x+progress*step*steps, progress_bar.y, 1);
} }
Plymouth.SetBootProgressFunction(progress_callback); Plymouth.SetBootProgressFunction(progress_callback);
...@@ -156,7 +166,7 @@ Plymouth.SetBootProgressFunction(progress_callback); ...@@ -156,7 +166,7 @@ Plymouth.SetBootProgressFunction(progress_callback);
fun quit_callback () fun quit_callback ()
{ {
logo.sprite.SetOpacity (0); logo.sprite.SetOpacity (1);
} }
Plymouth.SetQuitFunction(quit_callback); Plymouth.SetQuitFunction(quit_callback);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment