Mercurial > nagslang
annotate nagslang/screens/menu.py @ 18:9ecb1d222ee0
Screens.
author | Simon Cross <hodgestar@gmail.com> |
---|---|
date | Sun, 01 Sep 2013 14:48:21 +0200 |
parents | |
children | 113f31bd9d49 |
rev | line source |
---|---|
18 | 1 """Display a menu screen.""" |
2 | |
3 from pygame.rect import Rect | |
4 from pygame.color import Color | |
5 import pygame.locals as pyl | |
6 | |
7 from nagslang.screens.base import Screen | |
8 from nagslang.events import QuitEvent | |
9 | |
10 | |
11 class MenuScreen(Screen): | |
12 | |
13 def handle_event(self, ev): | |
14 if ev.type == pyl.KEYDOWN and ev.key == pyl.K_ESCAPE: | |
15 QuitEvent.post() | |
16 | |
17 def render(self, surface): | |
18 color = Color(255, 0, 0) | |
19 rect = Rect(10, 10, 200, 200) | |
20 surface.fill(color, rect) |