source: gamelib/mainmenu.py @ 5:67b79658b047

Last change on this file since 5:67b79658b047 was 5:67b79658b047, checked in by Simon Cross <hodgestar@…>, 11 years ago

Refactor and simplify menu.

File size: 730 bytes
Line 
1"""Main menu."""
2
3from pgu import gui
4import pygame
5import constants
6
7class MainMenu(gui.Table):
8    def __init__(self,**params):
9        gui.Table.__init__(self,**params)
10
11        def fullscreen_changed(btn):
12            pygame.display.toggle_fullscreen()
13
14        fg = (255,255,255)
15
16        self.tr()
17        self.td(gui.Label(constants.NAME, color=fg), colspan=2)
18
19        self.tr()
20        self.td(gui.Label("Start", color=fg), align=1)
21
22        btn = gui.Switch(value=False,name='fullscreen')
23        btn.connect(gui.CHANGE, fullscreen_changed, btn)
24
25        self.tr()
26        self.td(gui.Label("Full Screen: ",color=fg),align=1)
27        self.td(btn)
28
29        self.tr()
30        self.td(gui.Label("Quit", color=fg), align=1)
Note: See TracBrowser for help on using the repository browser.