Mercurial > boomslang
comparison gamelib/custom_widgets.py @ 681:497b6d7c55e7 pyntnclick
Reimplement JIM-style in gamelib
author | Neil Muller <neil@dip.sun.ac.za> |
---|---|
date | Sun, 12 Feb 2012 23:57:14 +0200 |
parents | |
children | c8b683dd56d3 |
comparison
equal
deleted
inserted
replaced
680:c9562e24bfed | 681:497b6d7c55e7 |
---|---|
1 """Custom widgets for Suspened Sentence""" | |
2 | |
3 import pygame | |
4 from pyntnclick.widgets.text import ModalWrappedTextLabel | |
5 | |
6 | |
7 class JimLabel(ModalWrappedTextLabel): | |
8 """Custom widget for JIM's speech""" | |
9 | |
10 def __init__(self, gd, mesg): | |
11 rect = pygame.Rect((0, 0), (1, 1)) | |
12 super(JimLabel, self).__init__(rect, gd, | |
13 text=mesg, fontname='Monospace.ttf', fontsize=20, | |
14 bg_color=pygame.Color(255, 175, 127, 191), | |
15 color=pygame.Color(0, 0, 0), | |
16 border_color=pygame.Color(127, 15, 0)) | |
17 # Centre the widget | |
18 # Should this happen automatically in state? | |
19 self.rect.center = (gd.constants.screen[0] / 2, | |
20 gd.constants.screen[1] / 2) |