import pygame.locals as pgl
-from naja.constants import KEYS
+from naja.constants import KEYS, PALETTE
from naja.scenes.scene import Scene
from naja.widgets.text import TextWidget, TextBoxWidget
from naja.events import QuitGameEvent
def __init__(self, state):
super(WinScene, self).__init__(state)
- self.add(TextWidget(
- (480, 160), 'You won!', fontsize=32, colour='white'))
+ self.add(TextWidget((50, 50), 'You won!', colour=PALETTE.WHITE))
+ self.add(TextWidget((50 + 64, 50), 'CHEATER!', colour=PALETTE.ORANGE))
self.add(TextBoxWidget(
- (120, 30), '\n'.join([
+ (50, 100), '\n'.join([
"You're great.",
"You did well.",
"You should be proud of yourself.",
- ]), fontsize=32,
- colour='white', padding=1, border=1,
- bg_colour='black', border_colour='black',
- box_width=100))
+ ]),
+ colour=PALETTE.WHITE, padding=1, border=1,
+ bg_colour=PALETTE.BLACK, border_colour=PALETTE.BLACK,
+ box_width=300))
def handle_scene_event(self, ev):
if ev.type == pgl.KEYDOWN and ev.key in KEYS.QUIT: