anims not fit quite share

This commit is contained in:
2026-02-11 08:45:30 +01:00
parent 6b8cd676a2
commit 9b65dbbdc9
2 changed files with 37 additions and 1 deletions
+36
View File
@@ -24,6 +24,8 @@ bool main_animation_started = false;
unsigned char bottom_text_state = 0; // 0 = "Technik informatyk", 1 = "technik programista"
unsigned char scroll_node_global_id = 0; // tracks current bottom-row node
bool scroll_node_active = false;
unsigned long main_animation_start_time = 0;
bool example_animation_triggered = false;
Image saved_images[MAX_IMAGES_SAVED] = {
{},{}
@@ -397,6 +399,30 @@ void stopAnimation(unsigned char index)
animations[index].is_playing = false;
}
void displayExampleSlideAnimation()
{
if (!animations[0].is_playing) return;
short offset_x = (DISPLAY_MAX_X + 1) - (short)animations[0].current_frame * 2;
for (unsigned char y = 0; y < PANEL_PIXEL_COUNT; y++)
{
for (unsigned char bx = 0; bx < PANEL_PIXEL_COUNT; bx++)
{
short px = offset_x + bx;
if (px < 0 || px > DISPLAY_MAX_X) continue;
unsigned char r, g, b;
if (y < 4) { r = 50; g = 0; b = 0; }
else if (y < 8) { r = 0; g = 50; b = 0; }
else if (y < 12) { r = 0; g = 0; b = 50; }
else { r = 50; g = 25; b = 0; }
setPixel(px, y, pixels.Color(r, g, b));
}
}
}
void handleDisappearTimers()
{
for (unsigned char i = 0; i < MAX_TEXT_NODES_COUNT; i++)
@@ -471,6 +497,7 @@ void loop()
if (!isNodeExistingByGlobal(0) && !isNodeExistingByGlobal(1))
{
main_animation_started = true;
main_animation_start_time = millis();
// Top row: "Witamy w PTI" — slow scroll, repeating, white + blue PTI
addNewMultiColor("Witamy w PTI",
@@ -506,11 +533,20 @@ void loop()
}
}
if (main_animation_started && !example_animation_triggered && millis() - main_animation_start_time > 15000)
{
example_animation_triggered = true;
animations[0].frame_count = 32;
playAnimation(0, 3, false);
}
pixels.clear();
handle_server();
handleDisappearTimers();
handleMultiColorDisappearTimers();
scrollAllScrollableTexts(true);
scrollAllMultiColorTexts(true);
tickAnimations();
displayExampleSlideAnimation();
pixels.show();
}