Mercurial > rinkhals
comparison gamelib/mainmenu.py @ 179:e2b5262c2b11
Add basic help screen
author | Neil Muller <drnlmuller@gmail.com> |
---|---|
date | Fri, 04 Sep 2009 15:00:54 +0000 |
parents | 082868bea873 |
children | bf1df0902883 |
comparison
equal
deleted
inserted
replaced
178:92387848caec | 179:e2b5262c2b11 |
---|---|
33 pygame.event.post(engine.QUIT) | 33 pygame.event.post(engine.QUIT) |
34 | 34 |
35 def start_pressed(): | 35 def start_pressed(): |
36 pygame.event.post(engine.START_DAY) | 36 pygame.event.post(engine.START_DAY) |
37 | 37 |
38 def help_pressed(): | |
39 pygame.event.post(engine.GO_HELP_SCREEN) | |
40 | |
38 start_button = gui.Button("Start") | 41 start_button = gui.Button("Start") |
39 start_button.connect(gui.CLICK, start_pressed) | 42 start_button.connect(gui.CLICK, start_pressed) |
40 | 43 |
41 quit_button = gui.Button("Quit") | 44 quit_button = gui.Button("Quit") |
42 quit_button.connect(gui.CLICK, quit_pressed) | 45 quit_button.connect(gui.CLICK, quit_pressed) |
46 | |
47 help_button = gui.Button("Instructions") | |
48 help_button.connect(gui.CLICK, help_pressed) | |
43 | 49 |
44 fullscreen_toggle = gui.Button("Toggle Fullscreen") | 50 fullscreen_toggle = gui.Button("Toggle Fullscreen") |
45 fullscreen_toggle.connect(gui.CLICK, fullscreen_toggled) | 51 fullscreen_toggle.connect(gui.CLICK, fullscreen_toggled) |
46 | 52 |
47 style = { | 53 style = { |
54 | 60 |
55 self.tr() | 61 self.tr() |
56 self.td(start_button, **td_kwargs) | 62 self.td(start_button, **td_kwargs) |
57 | 63 |
58 self.tr() | 64 self.tr() |
65 self.td(help_button, **td_kwargs) | |
66 | |
67 self.tr() | |
59 self.td(fullscreen_toggle, **td_kwargs) | 68 self.td(fullscreen_toggle, **td_kwargs) |
60 | 69 |
61 self.tr() | 70 self.tr() |
62 self.td(quit_button, **td_kwargs) | 71 self.td(quit_button, **td_kwargs) |