]> Skullheadx's Git Forge - Collision-Simulation.git/commitdiff
thumbnail capture at 3s thumbnail
authorSkullheadx <admonty1@gmail.com>
Fri, 27 Jan 2023 00:12:16 +0000 (19:12 -0500)
committerSkullheadx <admonty1@gmail.com>
Fri, 27 Jan 2023 00:12:16 +0000 (19:12 -0500)
display.py
thumbnail.png [new file with mode: 0644]

index 6045f91a1075cff14153c9746cba83297efcdc3f..4a7ce5606523b57814aec3a984fd65c01d9192c1 100644 (file)
@@ -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 (file)
index 0000000..c4590ed
Binary files /dev/null and b/thumbnail.png differ