Window.SetBackgroundTopColor(1,1,1); Window.SetBackgroundBottomColor (1,1,1); rata=Sprite(Image ("rata1.png")); rata1.SetOpacity(1); rata_anim=0; time=0; my_progress=0; esc_anim=0; /* sprite1=Sprite(Image.Text("anim:" + rata_anim)); sprite1.SetZ(1); */ background_image=Image("background.png"); temp=background_image.Scale(Window.GetWidth(),Window.GetHeight()); background_sprite=Sprite(temp); if (Plymouth.GetMode () == "shutdown") { sun_image=Image("moon.png"); } if (Plymouth.GetMode () == "boot") { sun_image=Image("sun.png"); } sun_sprite=Sprite(sun_image); sun_sprite.SetX(100); sun_sprite.SetY(200); sun.fadein=0; sun.fadeout=1; cloud_image=Image("cloud.png"); cloud_sprite=Sprite(cloud_image); cloud_sprite.SetX(6*Window.GetWidth()/7); randomY=220; cloud_sprite.SetY(randomY); cloud_pos.y=200; cloud_sprite.SetOpacity(0); cloud_sprite2=Sprite(cloud_image); cloud_sprite2.SetX(4*Window.GetWidth()/7); cloud_sprite2.SetY(320); cloud_sprite.SetOpacity(0); cloud.fadein=0; cloud.fadeout=1; cloud.anim=0; cloud.fadein2=0; cloud.fadeout2=1; cloud.anim2=0; /* logo_shadow_image=Image("logo_shadow.png"); logo_shadow_sprite=Sprite(logo_shadow_image); logo_shadow_sprite.SetX(Window.GetWidth()/2 - logo_shadow_image.GetWidth()/2); logo_shadow_sprite.SetY(Window.GetHeight()/6); */ logo_image=Image("logo_medium.png"); logo_sprite=Sprite(logo_image); logo_sprite.SetX(Window.GetWidth()/2 - logo_image.GetWidth()/2); logo_sprite.SetY(Window.GetHeight()/6); logo_sprite.SetOpacity(0); esc_image=Image("1.png"); esc_x=esc_image.GetWidth()*50/esc_image.GetHeight(); esc_y=50; esc_image_scaled=esc_image.Scale(esc_x,esc_y); esc=Sprite(esc_image_scaled); esc.SetX(20); esc.SetY(10); esc_image2=Image("2.png"); esc_image2_scaled=esc_image2.Scale(esc_x,esc_y); radius=Window.GetHeight()/9 - 0.5 * Window.GetHeight(); center.x=Window.GetWidth()/2; center.y=Window.GetHeight()/2; alpha=0; fun progress_callback (progress, time) { /* colorfade.r=166/256 + (-82/256 * progress); colorfade.g=193/256 + (53/256 * progress); colorfade.b=189/256 + (32/256 * progress); */ colorfade.r=Math.Cos(1.4*progress); } logo_progress=0; boot_status="null"; boot_msg="null"; fun refresh_callback() { my_progress+=0.0001; logo_sprite.SetOpacity(logo_progress); sun_condition=(center.y + Math.Sin(alpha)* radius) + sun_image.GetHeight()/2; if(sun_condition > 4*Window.GetHeight()/7) { if(sun.fadeout>=0) { sun.fadein=0; sun.fadeout-=0.05; sun_sprite.SetOpacity(sun.fadeout); } } else { if(sun.fadein <=1) { sun.fadeout=1; sun.fadein+=0.05; sun_sprite.SetOpacity(sun.fadein); } } if (logo_progress<1) logo_progress+=0.005; if(cloud.fadein<1) cloud.fadein+=0.02; if(cloud.fadein2<1) cloud.fadein2+=0.02; alpha=180*my_progress; print_variable=boot_status + " -- " + boot_msg; // sprite1=Sprite(Image.Text("MSGs " + print_variable)); rata_anim++; time++; if(rata_anim == 1) { mimage=Image("rata1.png"); // mimage=mimage2.Rotate(Math.Pi/3); rata=Sprite(mimage); } if(rata_anim == 2) { mimage=Image("rata2.png"); // mimage=mimage2.Rotate((Math.Pi/3)*2); rata=Sprite(mimage); } if(rata_anim == 3) { mimage=Image("rata3.png"); // mimage=mimage2.Rotate((Math.Pi/3)*3); rata=Sprite(mimage); } if(rata_anim == 4) { mimage=Image("rata4.png"); // mimage=mimage2.Rotate((Math.Pi/3)*4); rata=Sprite(mimage); } if(rata_anim == 5) { mimage=Image("rata5.png"); // mimage=mimage2.Rotate((Math.Pi/3)*5); rata=Sprite(mimage); } if(rata_anim == 6) { mimage=Image("rata6.png"); // mimage=mimage2.Rotate((Math.Pi/3)*6); rata=Sprite(mimage); } rata.SetX( Window.GetWidth()/2 - mimage.GetWidth()/2); rata.SetY(4*Window.GetHeight()/8); if (rata_anim==6) rata_anim=0; if(my_progress>1) my_progress=1; sun_sprite.SetX( (center.x + Math.Cos(alpha) * radius ) - sun_image.GetWidth()/2); sun_sprite.SetY( (center.y + Math.Sin(alpha)* radius) + sun_image.GetHeight()/2); cloud_sprite.SetOpacity(cloud.fadein); cloud_sprite2.SetOpacity(cloud.fadein2); cloud_sprite.SetX(5*Window.GetWidth()/7 - cloud.anim); cloud_sprite2.SetX(4*Window.GetWidth()/7 - cloud.anim2); cloud.anim+=3; cloud.anim2+=4; if(5*Window.GetWidth()/7 - cloud.anim <= 2*Window.GetWidth()/7) { cloud.fadeout-=0.02; cloud_sprite.SetOpacity(cloud.fadeout); } if(4*Window.GetWidth()/7 - cloud.anim2 <= 2*Window.GetWidth()/7) { cloud.fadeout2-=0.02; cloud_sprite2.SetOpacity(cloud.fadeout2); } if(cloud.fadeout <= 0) { cloud.anim=0; cloud.fadein=0; cloud.fadeout=1; cloud_sprite.SetOpacity(cloud.fadein); } if(cloud.fadeout2 <= 0) { cloud.anim2=0; cloud.fadein2=0; cloud.fadeout2=1; cloud_sprite2.SetOpacity(cloud.fadein2); } if(esc_anim<30) esc_anim++; else { esc_anim=0; } if(esc_anim>15) esc.SetImage(esc_image2_scaled); else esc.SetImage(esc_image_scaled); /* sprite1=Sprite(Image.Text("anim:" + esc_anim)); sprite1.SetZ(1); */ } fun update_status_callback(msg) { boot_status=msg; } fun message_callback(msg) { boot_msg=msg; } Plymouth.SetBootProgressFunction (progress_callback); Plymouth.SetRefreshFunction (refresh_callback); Plymouth.SetUpdateStatusFunction(update_status_callback); Plymouth.SetMessageFunction(message_callback);