From 2251377e9d076024321863276e5fbf39f785060b Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Fri, 25 Nov 2011 15:57:33 +0100 Subject: plymouth plugin: dots centered --- .../lib/plymouth/themes/unifr-rz/unifr-rz.script | 41 ++++++++++++---------- 1 file changed, 23 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/os-plugins/plugins/plymouth/files/lib/plymouth/themes/unifr-rz/unifr-rz.script b/src/os-plugins/plugins/plymouth/files/lib/plymouth/themes/unifr-rz/unifr-rz.script index 03732411..f2d8bd28 100644 --- a/src/os-plugins/plugins/plymouth/files/lib/plymouth/themes/unifr-rz/unifr-rz.script +++ b/src/os-plugins/plugins/plymouth/files/lib/plymouth/themes/unifr-rz/unifr-rz.script @@ -5,9 +5,8 @@ title_left_image = Image("rz_banner_trans.png"); title_right_image = Image("rz_logo_trans.png"); title_left_sprite = Sprite(title_left_image); title_right_sprite = Sprite(title_right_image); -screen_width = Window.GetWidth(); -title_right_sprite.SetX(screen_width - title_right_image.GetWidth()); +title_right_sprite.SetX(Window.GetWidth() - title_right_image.GetWidth()); dot.image = Image("white_dot_small.png"); dot.sprite1 = Sprite(dot.image); @@ -18,77 +17,83 @@ dot.sprite5 = Sprite(dot.image); #----------------------------------------- Progress Dots -------------------------------- -dot.x = Window.GetWidth() / 3; +dot.x = Window.GetWidth() / 2 - dot.image.GetWidth() / 2; dot.y = Window.GetHeight() * 0.75 - dot.image.GetHeight() / 2; +dot.spacing = Window.GetWidth() / 15; -dot.sprite1.SetPosition(dot.x, dot.y, 1); +# place 5 centered dots +dot.sprite1.SetPosition(dot.x - 2 * dot.spacing, dot.y, 1); +dot.sprite2.SetPosition(dot.x - dot.spacing, dot.y, 1); +dot.sprite3.SetPosition(dot.x, dot.y, 1); +dot.sprite4.SetPosition(dot.x + dot.spacing, dot.y, 1); +dot.sprite5.SetPosition(dot.x + 2 * dot.spacing, dot.y, 1); + +# set opacity dot.sprite1.SetOpacity(0.1); -dot.sprite2.SetPosition( ( Window.GetWidth() / 3 ) * 1.2 , dot.y, 1); dot.sprite2.SetOpacity(0.1); -dot.sprite3.SetPosition( ( Window.GetWidth() / 3 ) * 1.4 , dot.y, 1); dot.sprite3.SetOpacity(0.1); -dot.sprite4.SetPosition( ( Window.GetWidth() / 3 ) * 1.6 , dot.y, 1); dot.sprite4.SetOpacity(0.1); -dot.sprite5.SetPosition( ( Window.GetWidth() / 3 ) * 1.8 , dot.y, 1); dot.sprite5.SetOpacity(0.1); fun progress_callback (duration, progress) { - if ( Math.Int(duration * 2) % 10 == 1 ) + phase = Math.Int(duration * 2) % 10; + + if ( phase == 1 ) { fade_out(dot.sprite5); fade_in(dot.sprite1); } - if ( Math.Int(duration * 2) % 10 == 2 ) + if ( phase == 2 ) { fade_out(dot.sprite1); fade_in(dot.sprite2); } - if ( Math.Int(duration * 2) % 10 == 3 ) + if ( phase == 3 ) { fade_out(dot.sprite2); fade_in(dot.sprite3); } - if ( Math.Int(duration * 2) % 10 == 4 ) + if ( phase == 4 ) { fade_out(dot.sprite3); fade_in(dot.sprite4); } - if ( Math.Int(duration * 2) % 10 == 5 ) + if ( phase == 5 ) { fade_out(dot.sprite4); fade_in(dot.sprite5); } - if ( Math.Int(duration * 2) % 10 == 6 ) + if ( phase == 6 ) { fade_out(dot.sprite5); fade_in(dot.sprite1); } - if ( Math.Int(duration * 2) % 10 == 7 ) + if ( phase == 7 ) { fade_out(dot.sprite1); fade_in(dot.sprite2); } - if ( Math.Int(duration * 2) % 10 == 8 ) + if ( phase == 8 ) { fade_out(dot.sprite2); fade_in(dot.sprite3); } - if ( Math.Int(duration * 2) % 10 == 9 ) + if ( phase == 9 ) { fade_out(dot.sprite3); fade_in(dot.sprite4); } - if ( Math.Int(duration * 2) % 10 == 0 ) + if ( phase == 0 ) { fade_out(dot.sprite4); if ( Math.Int(duration) > 0 ) -- cgit v1.2.3-55-g7522