summaryrefslogtreecommitdiff
path: root/src/sliceitoff/display/display.py
diff options
context:
space:
mode:
authorViljami Ilola <+@hix.fi>2024-03-20 16:59:13 +0200
committerViljami Ilola <+@hix.fi>2024-03-20 16:59:13 +0200
commit398eebe7829622c6983cb28528f2208b4d596f32 (patch)
tree411f5d2fa3b7fc8b5352bc3cda49621fbd858919 /src/sliceitoff/display/display.py
parent191110be33196866998da385fbc3107344d2bf73 (diff)
text to srites. cache scaled font sprites...
Diffstat (limited to 'src/sliceitoff/display/display.py')
-rw-r--r--src/sliceitoff/display/display.py12
1 files changed, 11 insertions, 1 deletions
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()