changeset 180:d608e13aca9d

created
author 127.0.0.1
date Tue, 03 Jul 2012 06:59:32 +0200
parents 77bd47e65cc3
children 8fd03596d7d5
files docs/004%2F005%2Fpause.py
diffstat 1 files changed, 19 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/docs/004%2F005%2Fpause.py	Tue Jul 03 06:59:32 2012 +0200
@@ -0,0 +1,19 @@
+class Pause(object):
+    def __init__(self):
+        self.screen = pygame.display.get_surface()
+        self.background = pygame.surface.Surface(self.screen.get_size(),
+                pg.SRCALPHA)
+        self.background.fill((0x00, 0x00, 0x00, 0x66))
+        font = pygame.font.Font(None, 24)
+        text = font.render('Paused.', True, (0xff, 0xff, 0xff))
+        rect = text.get_rect()
+        rect.center = self.background.get_rect().center
+        self.background.blit(text, rect)
+
+    def run(self, scenes):
+        self.screen.blit(self.background, (0, 0))
+        pygame.display.update()
+        while True:
+            event = pygame.event.wait()
+            if event.type == pg.QUIT or event.type == pg.KEYDOWN:
+                return