X-Git-Url: https://git.ctpug.org.za/?a=blobdiff_plain;f=tabakrolletjie%2Fscenes%2Fmenu.py;h=0492ae9e38c42083ef506d0f42d8b6e5dbcdafd8;hb=3dd84f63b3435d92e08c39d6a46fb8179a7b43a2;hp=ed7cc3194ff34105a08ef3c5c1630f549502502a;hpb=9210e142ff050395c274926f99ef577a46f84736;p=tabakrolletjie.git diff --git a/tabakrolletjie/scenes/menu.py b/tabakrolletjie/scenes/menu.py index ed7cc31..0492ae9 100644 --- a/tabakrolletjie/scenes/menu.py +++ b/tabakrolletjie/scenes/menu.py @@ -4,6 +4,8 @@ import pygame.locals as pgl from .base import BaseScene from ..events import QuitEvent, SceneChangeEvent +from ..loader import loader +from ..constants import FONTS class MenuScene(BaseScene): @@ -11,9 +13,26 @@ class MenuScene(BaseScene): if gamestate.station is None: print "Loading Station Alpha ..." gamestate.load_station("station-alpha.json") + font_title = loader.load_font(FONTS['bold'], size=32) + self._title = font_title.render('A Game with a title', True, + (255, 255, 255)) + font_menu = loader.load_font(FONTS['sans'], size=24) + self._menu = [ + font_menu.render("Load Level", True, (255, 255, 255)), + font_menu.render("Load Saved Game", True, (255, 255, 255)), + ] def render(self, surface, gamestate): - surface.fill((0, 255, 0)) + surface.fill((0, 128, 0)) + + pos = ((surface.get_width() - self._title.get_width()) / 2, 50) + surface.blit(self._title, pos, None) + + height = 150 + for item in self._menu: + pos = ((surface.get_width() - item.get_width()) / 2, height) + surface.blit(item, pos, None) + height += 50 def event(self, ev, gamestate): if ev.type == pgl.KEYDOWN: