view gamelib/menu.py @ 74:75e1040a1121

Hacky "detail view" widget prototype.
author Jeremy Thurgood <firxen@gmail.com>
date Mon, 23 Aug 2010 21:26:48 +0200
parents 05346a412b55
children c76f2fad2af5
line wrap: on
line source

# menu.py
# Copyright Boomslang team, 2010 (see COPYING File)
# Main menu for the game

from albow.screen import Screen
from albow.controls import Button, Label
from albow.layout import Column

from cursor import CursorSpriteScreen

class MenuScreen(CursorSpriteScreen):
    def __init__(self, shell):
        CursorSpriteScreen.__init__(self, shell)
        StartButton = Button('Start New Game', action = self.start)
        QuitButton = Button('Quit', action = shell.quit)
        Title = Label('Suspended Sentence')
        menu = Column([
            Title,
            StartButton,
            QuitButton,
            ], align='l', spacing=20)
        self.add_centered(menu)

    def start(self):
        print 'Starting the game'
        self.shell.show_screen(self.shell.game_screen)