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
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)