Update new game screen to use new goodies.
authorSimon Cross <hodgestar@gmail.com>
Fri, 16 May 2014 23:47:34 +0000 (01:47 +0200)
committerSimon Cross <hodgestar@gmail.com>
Fri, 16 May 2014 23:47:46 +0000 (01:47 +0200)
naja/scenes/new_game.py

index c63631968ca576a2a4ddcc075143c0c3af125747..da41c01e773d8f52fe24b03a4b41df4ea30b6d02 100644 (file)
@@ -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)