PDA

View Full Version : Plymouth



StalkerQF
August 17th, 2013, 06:25 AM
Hello!

I want to create my splash-theme for plymouth daemon. I try to write plymouth script, but he doesn't work. Can you halp me with it?


# This is a simple testing script for Plymouth daemon.

Window.SetBackgroundTopColor (0.16, 0.00, 0.12);
Window.SetBackgroundBottomColor (0.16, 0.00, 0.12);
logo.image = Image ("ubuntu_logo16.png"); //выбираем изображение логотипа


logo.sprite = Sprite (); //создаем новый спрайт
logo.sprite.SetImage (logo.image);


logo.width = logo.image.GetWidth ();
logo.height = logo.image.GetHeight ();
logo.x = Window.GetX () + Window.GetWidth () / 2 - logo.width / 2;
logo.y = Window.GetY () + Window.GetHeight () / 2 - logo.height;
logo.z = 1000;


logo.sprite.SetX (logo.x); //задаём координаты логотипа
logo.sprite.SetY (logo.y);
logo.sprite.SetZ (logo.z);


logo.sprite.SetOpacity (1);




light.image = Image ("light.png");


light.sprit = Sprite (light.image);


light.width = light.image.GetWidth ();
light.height = light.image.GetHeight ();
llight.x = Window.GetX () + Window.GetWidth () / 2 - llight.width / 2;
light.y = Window.GetY () + Window.GetHeight () / 2 - light.height;
light.z = 100;


light.sprite.SetX (light.x);
light.sprite.SetY (light.y);
light.sprite.SetZ (light.z);


#light.sprite.SetOpacity (1);


fun pulse ()
{
int flag;
float counter;
if (flag = 0)
{if (counter < 1)
{
counter = counter + 0.02;
light.sprite.SetOpacity (counter);
}
else
flag = 1;
}
else
{if (counter > 0)
{
counter = counter - 0.02;
light.sprite.SetOpacity (counter);
}
else
flag = 0;
}
}


Plymouth.SetRefreshFunction (pulse);

Thanks.