X-Git-Url: https://git.ctpug.org.za/?p=tabakrolletjie.git;a=blobdiff_plain;f=tabakrolletjie%2Fscenes%2Fload_level.py;h=7f3223fefd7139eac18053cdc720deb5c83f8e17;hp=6c219a00338cf85c1c5f89b77220943c61c46afe;hb=30bbdf89429d8669ff1b595171a2a956bed7d377;hpb=4ca572005f4f535a665db7ae6ad7ea28dead51c5 diff --git a/tabakrolletjie/scenes/load_level.py b/tabakrolletjie/scenes/load_level.py index 6c219a0..7f3223f 100644 --- a/tabakrolletjie/scenes/load_level.py +++ b/tabakrolletjie/scenes/load_level.py @@ -5,6 +5,7 @@ import os import pygame.locals as pgl from .base import BaseScene +from ..constants import SCREEN_SIZE from ..events import SceneChangeEvent from ..widgets import TextButton from ..loader import loader @@ -20,23 +21,23 @@ class LoadLevelScene(BaseScene): def enter(self, gamestate): """Construct list of stations""" - height = 50 - width = 30 + width = SCREEN_SIZE[0] / 2 + self._title = TextButton( + 'Select a planet:', (255, 255, 255), pos=(width, 75), + size=32, font='bold', centre=True) + height = 150 self._buttons = [] for station in self._list_stations(): title = station["config"]["name"] pos = (width, height) - button = TextButton(title, (255, 255, 255), None, pos) + button = TextButton(title, (255, 255, 255), pos=pos, centre=True) button.station = station - if width < 400: - width += 350 - else: - width = 30 - height += button.get_height() + 20 + height += button.get_height() + 20 self._buttons.append(button) def render(self, surface, gamestate): surface.fill((0, 128, 128)) + self._title.render(surface) for button in self._buttons: button.render(surface)