Mercurial > boomslang
comparison gamelib/custom_widgets.py @ 852:f95830b58336
Merge pyntnclick
author | Stefano Rivera <stefano@rivera.za.net> |
---|---|
date | Sat, 21 Jun 2014 22:04:35 +0200 |
parents | bcc9277a23e6 |
children |
comparison
equal
deleted
inserted
replaced
546:ad4d6ffd25d7 | 852:f95830b58336 |
---|---|
1 """Custom widgets for Suspened Sentence""" | |
2 | |
3 import pygame | |
4 from pyntnclick.widgets.text import WrappedTextLabel | |
5 | |
6 | |
7 class JimLabel(WrappedTextLabel): | |
8 """Custom widget for JIM's speech""" | |
9 | |
10 def __init__(self, gd, mesg): | |
11 pos = (0, 0) | |
12 size = None | |
13 super(JimLabel, self).__init__(pos, gd, size=size, | |
14 text=mesg, fontname='Monospace.ttf', fontsize=20, | |
15 bg_color=pygame.Color(255, 175, 127, 191), | |
16 color=pygame.Color(0, 0, 0), | |
17 border_color=pygame.Color(127, 15, 0)) | |
18 | |
19 def prepare(self): | |
20 # Centre the widget | |
21 super(JimLabel, self).prepare() | |
22 self.rect.center = (self.gd.constants.screen[0] / 2, | |
23 self.gd.constants.screen[1] / 2) |