From: Skullheadx Date: Fri, 27 Jan 2023 00:12:16 +0000 (-0500) Subject: thumbnail capture at 3s X-Git-Url: http://git.skullheadx.com/nixos/blog/static/gitweb.css?a=commitdiff_plain;h=a637ee2af2c61010375d684755864d2279387004;p=Collision-Simulation.git thumbnail capture at 3s --- diff --git a/display.py b/display.py index 6045f91..4a7ce56 100644 --- a/display.py +++ b/display.py @@ -16,7 +16,7 @@ pygame.display.set_icon(icon) class Display: - WIDTH, HEIGHT = 1080, 720 + WIDTH, HEIGHT = 1280,640 DIMENSIONS = (WIDTH, HEIGHT) CENTER = (WIDTH / 2, HEIGHT / 2) @@ -54,12 +54,21 @@ class Display: screen = pygame.display.set_mode(self.DIMENSIONS) clock = pygame.time.Clock() delta = 0 + + time = 0 + self.is_running = True while self.is_running: self.update(delta) self.draw(screen) pygame.display.update() delta = clock.tick() + + time += delta + print(time) + if time >= 3000: + pygame.image.save(screen, "thumbnail.png") + self.is_running = False pygame.quit() def update(self, delta): diff --git a/thumbnail.png b/thumbnail.png new file mode 100644 index 0000000..c4590ed Binary files /dev/null and b/thumbnail.png differ