Changeset 365:a43f571e8f5b


Ignore:
Timestamp:
04/09/11 12:39:18 (12 years ago)
Author:
Stefano Rivera <stefano@…>
Branch:
default
Phase:
public
Rebase:
38383263306262343439613734396235623362653563616166326132346561353431343131366537
Message:

Dim cutscene background

File:
1 edited

Legend:

Unmodified
Added
Removed
  • skaapsteker/cutscene.py

    r277 r365  
    33
    44import pygame
    5 from pygame.locals import K_ESCAPE, K_q, KEYDOWN
     5from pygame.locals import K_ESCAPE, K_q, KEYDOWN, SRCALPHA
    66
     7from . import constants
    78from . import data
    89from .engine import ChangeScene, Scene
     
    1314        super(CutScene, self).__init__(game_state, soundsystem)
    1415        self.background = data.load_image('backgrounds/' + background)
     16        fill = pygame.Surface(self.background.get_size(), flags=SRCALPHA)
     17        fill.fill((255, 255, 255, 128))
     18        self.background.convert_alpha(fill)
     19        self.background.blit(fill, (0, 0))
     20        self.background.convert_alpha()
    1521        self.start_time = pygame.time.get_ticks()
    1622        self.run_time = 60000 # ms
     
    1925        self._background_music = music
    2026
    21         text_widget = Text(text, pygame.Rect(20, 20, 800-40, 600-40),
     27        text_widget = Text(text, pygame.Rect(20, 20,
     28                                             constants.SCREEN[0] - 40,
     29                                             constants.SCREEN[1] - 40),
    2230                           size=24, shadow='gray', wrap=True)
    2331        self.widgets.append(text_widget)
    2432
    2533        button_set = ButtonSet()
    26         button_set.append(TextButton("Continue", (300, 500), size=24, color='yellow'))
     34        # TODO: Dynamic position
     35        button_set.append(TextButton("Continue", (20, constants.SCREEN[1] - 68),
     36                                     size=24, color='red'))
    2737        button_set.callbacks.append(self.done)
    2838        self.widgets.append(button_set)
Note: See TracChangeset for help on using the changeset viewer.