From: Simon Cross Date: Fri, 16 May 2014 23:24:38 +0000 (+0200) Subject: Make Credits a scrollable text box. X-Git-Tag: 0.1~151 X-Git-Url: https://git.ctpug.org.za/?a=commitdiff_plain;h=bd58a6d642cee4d896cbeb7ee698923f0b7f7330;p=naja.git Make Credits a scrollable text box. --- diff --git a/naja/scenes/credits.py b/naja/scenes/credits.py index 1558142..b6f95b3 100644 --- a/naja/scenes/credits.py +++ b/naja/scenes/credits.py @@ -6,7 +6,8 @@ import pygame.locals as pgl from naja.constants import KEYS from naja.scenes.scene import Scene -from naja.widgets.text import TextWidget, TextBoxWidget +from naja.widgets.text import TextBoxWidget +from naja.widgets.image_box import ImageBox from naja.events import SceneChangeEvent @@ -17,25 +18,30 @@ class CreditsScene(Scene): def __init__(self, state): super(CreditsScene, self).__init__(state) - self.add(TextWidget( - (400, 30), 'Credits', fontsize=32, colour='white', centre=True)) - self.add(TextWidget( - (400, 80), 'A game about robots and bits and other things', - fontsize=32, colour='white', centre=True)) - self.add(TextWidget( - (400, 120), 'by', fontsize=32, colour='white', centre=True)) - self.add(TextBoxWidget( - (20, 160), 'Adrianna Pinska, David Sharpe, Jeremy Thurgood, ' - 'Neil Muller, Simon Cross & Stefano Rivera', - fontsize=32, colour='white', padding=1, border=1, - bg_colour='black', border_colour='black', - box_width=640)) + + background = ImageBox( + (0, 0), "screens/splash.png") + self.add(background) + self.add(TextBoxWidget( - (30, 280), - 'Music by Rolemusic: http://rolemusic.sawsquarenoise.com/', - fontsize=32, colour='white', padding=1, border=1, - bg_colour='black', border_colour='black', - box_width=640)) + (10, 350), '\n'.join([ + 'CREDITS', + '', + 'A game about robots and bits and other things', + '', + 'by', + '', + 'Adrianna Pinska, David Sharpe, Jeremy Thurgood, ' + 'Neil Muller, Simon Cross & Stefano Rivera', + '', + 'Music by Rolemusic:', + 'http://rolemusic.sawsquarenoise.com/', + '', + 'Press ESC to return to the menu.', + ]), + colour='white', padding=1, + bg_colour=(0, 0, 0, 0), centre=True, + box_width=640, view_port=(780, 230))) def handle_scene_event(self, ev): if ev.type == pgl.KEYDOWN and ev.key in KEYS.QUIT: