from .base import BaseScene
from ..events import QuitEvent, SceneChangeEvent
+from ..loader import loader
+from ..constants import FONTS
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: