# HG changeset patch # User Jeremy Thurgood # Date 1283022336 -7200 # Node ID 1555677d86f60e35cf144735d3f65b6cfe98b1d4 # Parent b1dc0caec66896654dfe74812d8a7c4ecec94814 Dim non-interactive screen regions for "modal" stuff. diff -r b1dc0caec668 -r 1555677d86f6 gamelib/gamescreen.py --- 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): diff -r b1dc0caec668 -r 1555677d86f6 gamelib/widgets.py --- a/gamelib/widgets.py Sat Aug 28 20:46:06 2010 +0200 +++ b/gamelib/widgets.py Sat Aug 28 21:05:36 2010 +0200 @@ -104,11 +104,15 @@ if style == "JIM": self.set(font=get_font(20, "Monospace.ttf")) self.trim_line_top = 10 - self.bg_color = Color(255, 175, 127, 207) + self.bg_color = Color(255, 175, 127, 191) self.fg_color = (0, 0, 0) self.border_color = (127, 15, 0) def draw_all(self, surface): + root_surface = self.get_root().surface + overlay = root_surface.convert_alpha() + overlay.fill(Color(0, 0, 0, 191)) + root_surface.blit(overlay, (0, 0)) BoomLabel.draw_all(self, surface) def _draw_all_no_bg(self, surface):