From ca2f0a92b80668b67455d11a9365ffcd71b78833 Mon Sep 17 00:00:00 2001 From: Simon Cross Date: Sat, 17 May 2014 01:47:34 +0200 Subject: [PATCH] Update new game screen to use new goodies. --- naja/scenes/new_game.py | 39 ++++++++++++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 5 deletions(-) diff --git a/naja/scenes/new_game.py b/naja/scenes/new_game.py index c636319..da41c01 100644 --- a/naja/scenes/new_game.py +++ b/naja/scenes/new_game.py @@ -8,6 +8,7 @@ from naja.constants import KEYS from naja.events import SceneChangeEvent, LoadGameEvent from naja.gamestate import GameState from naja.scenes.scene import Scene +from naja.widgets.image_box import ImageBox from naja.widgets.selector import SelectorWidget from naja.widgets.text import TextWidget @@ -15,27 +16,55 @@ from naja.widgets.text import TextWidget class NewGameScene(Scene): def __init__(self, state): super(NewGameScene, self).__init__(state) + + background = ImageBox( + (0, 0), "screens/splash.png") + self.add(background) + selector = SelectorWidget() selector.position = 1 self.add(selector) - title = TextWidget((100, 50), 'Select difficulty', colour='white') + y_offset, y_diff = 270, 40 + x_offset = 400 + + y_offset += y_diff + title = TextWidget( + (x_offset, y_offset), 'NEW GAME', colour='white', + centre=True) self.add(title) - easy = TextWidget((200, 150), 'Easy', fontsize=32, colour='white') + y_offset += y_diff + question = TextWidget( + (x_offset, y_offset), 'Select difficulty:', colour='white', + centre=True) + self.add(question) + + y_offset += y_diff + easy = TextWidget( + (x_offset, y_offset), 'Easy', fontsize=32, colour='white', + centre=True) easy.add_callback('click', self.easy_game) selector.add(easy) + y_offset += y_diff standard = TextWidget( - (200, 200), 'Standard', fontsize=32, colour='white') + (x_offset, y_offset), 'Standard', fontsize=32, colour='white', + centre=True) standard.add_callback('click', self.standard_game) selector.add(standard) - hard = TextWidget((200, 250), 'Hard', fontsize=32, colour='white') + y_offset += y_diff + hard = TextWidget( + (x_offset, y_offset), 'Hard', fontsize=32, colour='white', + centre=True) hard.add_callback('click', self.hard_game) selector.add(hard) - puzzle = TextWidget((200, 300), 'Puzzle', fontsize=32, colour='white') + y_offset += y_diff + puzzle = TextWidget( + (x_offset, y_offset), 'Puzzle', fontsize=32, colour='white', + centre=True) puzzle.add_callback('click', self.puzzle_game) selector.add(puzzle) -- 2.34.1