From fe7ffcf963febbf8ae05bf1cad61ec371e660e61 Mon Sep 17 00:00:00 2001 From: Alex Frantz Date: Sun, 2 Aug 2026 05:56:46 -0400 Subject: [PATCH] smooth out scrolling --- main.py | 3 +-- modes/fantasy.py | 4 ++-- modes/score.py | 7 ++----- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/main.py b/main.py index d8eef5c..40ec44d 100644 --- a/main.py +++ b/main.py @@ -8,7 +8,6 @@ scoreboard_matrix = ScoreboardMatrix() def main(): while True: - print(scoreboard_matrix.current_slide) if scoreboard_matrix.current_slide == "score": canvas = score.draw_frame(scoreboard_matrix) if not canvas: @@ -26,6 +25,6 @@ def main(): else: scoreboard_matrix.canvas = scoreboard_matrix.matrix.SwapOnVSync(canvas) - sleep(0.5) + sleep(0.1) main() \ No newline at end of file diff --git a/modes/fantasy.py b/modes/fantasy.py index ecd1ed7..1588818 100644 --- a/modes/fantasy.py +++ b/modes/fantasy.py @@ -11,8 +11,8 @@ players = { last_fetch = 0 scroll_x = 0 -scroll_speed = 10 -frames_per_tick = 2 +scroll_speed = 1 +frames_per_tick = 1 tick = 0 times_scrolled = 0 virtual_canvas = None diff --git a/modes/score.py b/modes/score.py index d2ec875..d45252e 100644 --- a/modes/score.py +++ b/modes/score.py @@ -16,8 +16,8 @@ preferred_teams = [ ] scroll_x = 0 -scroll_speed = 10 -frames_per_tick = 2 +scroll_speed = 1 +frames_per_tick = 1 tick = 0 times_scrolled = 0 virtual_canvas = None @@ -198,13 +198,10 @@ def draw_frame(matrix): blit_slice(matrix.canvas, virtual_canvas, scroll_x) draw_text_overlay(matrix.canvas, ordered, scroll_x) - print(tick) - tick += 1 if tick >= frames_per_tick: tick = 0 next_x = scroll_x + scroll_speed - print(scroll_x, scroll_speed, next_x, total_scroll_width) if next_x >= total_scroll_width: scroll_x = 0 tick = 0