projects
/
naja.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Blank the screen on each frame
[naja.git]
/
naja
/
scenes
/
menu.py
diff --git
a/naja/scenes/menu.py
b/naja/scenes/menu.py
index 7b42ad7b730d90959f078e89c4ffe98ed13207d5..822c87a1eb77db35d98b965694c3aff81e7b4dae 100644
(file)
--- a/
naja/scenes/menu.py
+++ b/
naja/scenes/menu.py
@@
-2,17
+2,21
@@
Main menu scene.
"""
Main menu scene.
"""
+import pygame.locals as pgl
+
from naja.scenes.scene import Scene
from naja.widgets.text import TextWidget
from naja.scenes.scene import Scene
from naja.widgets.text import TextWidget
+from naja.events import QuitGameEvent
class MenuScene(Scene):
def __init__(self):
class MenuScene(Scene):
def __init__(self):
- self.tw = TextWidget((10, 10), 'Haai', colour=(255, 255, 255))
-
- def render(self, surface):
- self.tw.render(surface)
+ super(MenuScene, self).__init__()
+ self.widgets.append(TextWidget((10, 10), 'Haai',
+ colour=(255, 255, 255)))
def handle_event(self, ev):
def handle_event(self, ev):
- pass
+ if ev.type == pgl.KEYUP and ev.key in (pgl.K_q, pgl.K_ESCAPE):
+ QuitGameEvent.post()
+ return