comparison gamelib/custom_widgets.py @ 854:3577c51029f1 default tip

Remove Suspended Sentence. pyntnclick is the library we extracted from it
author Stefano Rivera <stefano@rivera.za.net>
date Sat, 21 Jun 2014 22:15:54 +0200
parents f95830b58336
children
comparison
equal deleted inserted replaced
853:f95830b58336 854:3577c51029f1
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)