diff gamelib/gamescreen.py @ 398:1555677d86f6

Dim non-interactive screen regions for "modal" stuff.
author Jeremy Thurgood <firxen@gmail.com>
date Sat, 28 Aug 2010 21:05:36 +0200
parents b1dc0caec668
children 92029c76b687
line wrap: on
line diff
--- a/gamelib/gamescreen.py	Sat Aug 28 20:46:06 2010 +0200
+++ b/gamelib/gamescreen.py	Sat Aug 28 21:05:36 2010 +0200
@@ -140,6 +140,10 @@
         self.close.rect.midbottom = rect.midbottom
 
     def draw(self, surface):
+        scene_surface = self.get_root().surface.subsurface(self.parent.rect)
+        overlay = scene_surface.convert_alpha()
+        overlay.fill(Color(0, 0, 0, 191))
+        scene_surface.blit(overlay, (0, 0))
         self.state.draw_detail(surface.subsurface(self.image_rect), self.screen)
 
     def mouse_down(self, event):