From 398eebe7829622c6983cb28528f2208b4d596f32 Mon Sep 17 00:00:00 2001 From: Viljami Ilola <+@hix.fi> Date: Wed, 20 Mar 2024 16:59:13 +0200 Subject: text to srites. cache scaled font sprites... --- src/sliceitoff/display/display.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/sliceitoff/display/display.py') diff --git a/src/sliceitoff/display/display.py b/src/sliceitoff/display/display.py index 54b1586..2d6605f 100644 --- a/src/sliceitoff/display/display.py +++ b/src/sliceitoff/display/display.py @@ -1,9 +1,12 @@ +import os import pygame from stats import Stats from .scaling import Scaling +DEBUG = os.getenv("DEBUG") + class Display(): def __init__(self): @@ -14,10 +17,17 @@ class Display(): pygame.FULLSCREEN | pygame.SCALED, vsync = 1 ) Scaling.update_scaling(self.screen.get_size()) + self.screen.fill(Stats.bordercolor) + if DEBUG: + print( + "DISPLAY: \n" + f" {Scaling.active = }\n" + f" {Scaling.border = }\n" + f" {Scaling.factor = }\n") def update(self, groups = None): """ Updates the screen: clear, blit gropus and flip """ - self.screen.fill(Stats.bgcolor) + self.screen.fill(Stats.bgcolor, rect=Scaling.active) for group in groups: group.draw(self.screen) pygame.display.flip() -- cgit v1.2.3