Will it blend?
authorSimon Cross <hodgestar@gmail.com>
Sat, 5 Mar 2016 15:48:48 +0000 (17:48 +0200)
committerSimon Cross <hodgestar@gmail.com>
Sat, 5 Mar 2016 15:48:56 +0000 (17:48 +0200)
koperkapel/scenes/roach_management.py

index 4cc0395ae1e668abbcb4978f425f6d6d47f9d870..6c867fb4f196142b424a7508c063b7bca751026f 100644 (file)
@@ -1,5 +1,6 @@
 """ Roach management scene. """
 
+from pygame.constants import BLEND_RGBA_MULT, BLEND_RGBA_SUB
 from pgzero.constants import keys, mouse
 from pgzero.actor import Actor
 from pgzero.screen import Screen
@@ -69,7 +70,13 @@ class RoachesScene(Scene):
         base.blit(overlay, (0, 0))
         frame = self._vehicle.roach_management_frame()
         if frame is not None:
-            base.blit(frame, (0, 0))
+            frame = frame.copy()
+            frame.fill((255, 255, 255, 8), None, BLEND_RGBA_MULT)
+            frame_rect = frame.get_rect()
+            base.blit(frame, (
+                VEHICLE_MID_X - frame_rect.w // 2,
+                VEHICLE_MID_Y - frame_rect.h // 2),
+                None, BLEND_RGBA_SUB)
         self.actors.default.add(SurfActor(base))
 
     def _init_seats(self):