45 lines
1.3 KiB
Plaintext
45 lines
1.3 KiB
Plaintext
# WESP Plymouth theme — полноэкранная анимация 800×600 (кадры animation/N.png)
|
|
|
|
screen.width = Window.GetWidth();
|
|
screen.height = Window.GetHeight();
|
|
|
|
# Тёмный фон (#0f1114), как data-theme="dark"
|
|
Window.SetBackgroundTopColor(0.0588, 0.0667, 0.0784);
|
|
Window.SetBackgroundBottomColor(0.0588, 0.0667, 0.0784);
|
|
|
|
animation.length = 0;
|
|
animation.images = [];
|
|
|
|
while (1) {
|
|
local.path = "animation/" + animation.length + ".png";
|
|
local.frame = Image(local.path);
|
|
if (!frame)
|
|
break;
|
|
animation.images[animation.length++] = frame;
|
|
}
|
|
|
|
animation.current_frame = 0;
|
|
animation.sprite = Sprite();
|
|
|
|
fun refresh_callback() {
|
|
if (animation.length == 0)
|
|
return;
|
|
|
|
local.frame = animation.images[animation.current_frame];
|
|
animation.sprite.SetImage(frame);
|
|
|
|
# Кадры 800×600 — на других разрешениях центрируем
|
|
animation.sprite.SetX((screen.width - frame.GetWidth()) / 2);
|
|
animation.sprite.SetY((screen.height - frame.GetHeight()) / 2);
|
|
|
|
animation.current_frame++;
|
|
if (animation.current_frame >= animation.length)
|
|
animation.current_frame = 0;
|
|
}
|
|
|
|
Plymouth.SetRefreshFunction(refresh_callback);
|
|
|
|
fun quit_callback() {}
|
|
|
|
Plymouth.SetQuitFunction(quit_callback);
|