projects
/
naja.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Turn resources into a module, which can hold mutators too
[naja.git]
/
naja
/
scenes
/
menu.py
diff --git
a/naja/scenes/menu.py
b/naja/scenes/menu.py
index c1fd5f814513eddab54e345c9671b8dc312c9425..771cf33318cd8b227b0a534ac9fc06939036291d 100644
(file)
--- a/
naja/scenes/menu.py
+++ b/
naja/scenes/menu.py
@@
-2,16
+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):
super(MenuScene, self).__init__()
class MenuScene(Scene):
def __init__(self):
super(MenuScene, self).__init__()
- self.widgets.append(TextWidget((10, 10), 'Haai',
- colour=
(255, 255, 255)
))
+ self.widgets.append(TextWidget((10, 10), 'Haai',
fontsize=32,
+ colour=
'white'
))
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