summaryrefslogtreecommitdiff
path: root/src/sliceitoff/display/display.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/sliceitoff/display/display.py')
-rw-r--r--src/sliceitoff/display/display.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/sliceitoff/display/display.py b/src/sliceitoff/display/display.py
index 65b4713..a161dc4 100644
--- a/src/sliceitoff/display/display.py
+++ b/src/sliceitoff/display/display.py
@@ -7,6 +7,14 @@ from .static import CGA_COLORS
DEBUG = os.getenv("DEBUG")
+def gen_backdrop(color, color2):
+ """ generates backdrop with 50% dithering """
+ srfc = pygame.Surface((320, 240))
+ for x in range(320):
+ for y in range(240):
+ srfc.set_at((x,y),color if (x+y)%2 else color2)
+ return srfc
+
class Display():
"""display.Display - Handles graphics. Init, clear, draw, borders... """
@@ -18,6 +26,9 @@ class Display():
pygame.FULLSCREEN | pygame.SCALED,
vsync = 1 )
Scaling.update_scaling(self.screen.get_size())
+ self.backdrop = pygame.transform.scale_by(
+ gen_backdrop(CGA_COLORS[1], CGA_COLORS[8]),
+ 1_000 * Scaling.factor)
if DEBUG:
print(
"DISPLAY: \n"
@@ -30,7 +41,8 @@ class Display():
def update(self, groups = None):
""" Updates the screen: clear, blit gropus and flip """
- self.screen.fill(CGA_COLORS[4], rect=Scaling.active)
+ self.screen.blit(self.backdrop, (Scaling.left,Scaling.top))
+ # fill(CGA_COLORS[4], rect=Scaling.active)
for group in groups:
group.draw(self.screen)
self.screen.fill(0, rect=Scaling.borders[0])