# HG changeset patch # User Stefano Rivera # Date 1302352758 -7200 # Node ID a43f571e8f5bbf605dbd16d19cf401a531cf685a # Parent 14142aee4c0341833d672f63ee0a4835cdbe480e Dim cutscene background diff -r 14142aee4c03 -r a43f571e8f5b skaapsteker/cutscene.py --- a/skaapsteker/cutscene.py Sat Apr 09 14:30:36 2011 +0200 +++ b/skaapsteker/cutscene.py Sat Apr 09 14:39:18 2011 +0200 @@ -2,8 +2,9 @@ from __future__ import division import pygame -from pygame.locals import K_ESCAPE, K_q, KEYDOWN +from pygame.locals import K_ESCAPE, K_q, KEYDOWN, SRCALPHA +from . import constants from . import data from .engine import ChangeScene, Scene from .widgets.text import Text, ButtonSet, TextButton, unindent_text @@ -12,18 +13,27 @@ def __init__(self, game_state, soundsystem, text, background, music=None): super(CutScene, self).__init__(game_state, soundsystem) self.background = data.load_image('backgrounds/' + background) + fill = pygame.Surface(self.background.get_size(), flags=SRCALPHA) + fill.fill((255, 255, 255, 128)) + self.background.convert_alpha(fill) + self.background.blit(fill, (0, 0)) + self.background.convert_alpha() self.start_time = pygame.time.get_ticks() self.run_time = 60000 # ms self._background_music = None self._background_music = music - text_widget = Text(text, pygame.Rect(20, 20, 800-40, 600-40), + text_widget = Text(text, pygame.Rect(20, 20, + constants.SCREEN[0] - 40, + constants.SCREEN[1] - 40), size=24, shadow='gray', wrap=True) self.widgets.append(text_widget) button_set = ButtonSet() - button_set.append(TextButton("Continue", (300, 500), size=24, color='yellow')) + # TODO: Dynamic position + button_set.append(TextButton("Continue", (20, constants.SCREEN[1] - 68), + size=24, color='red')) button_set.callbacks.append(self.done) self.widgets.append(button_set)