Mercurial > pyntnclick
comparison gamelib/custom_widgets.py @ 726:efa58c92b304 pyntnclick
Move prepare out of __init__ and into everywhere else
author | Neil Muller <neil@dip.sun.ac.za> |
---|---|
date | Tue, 15 Jan 2013 22:44:50 +0200 |
parents | c8b683dd56d3 |
children | bcc9277a23e6 |
comparison
equal
deleted
inserted
replaced
725:65e9b5c40233 | 726:efa58c92b304 |
---|---|
12 super(JimLabel, self).__init__(rect, gd, | 12 super(JimLabel, self).__init__(rect, gd, |
13 text=mesg, fontname='Monospace.ttf', fontsize=20, | 13 text=mesg, fontname='Monospace.ttf', fontsize=20, |
14 bg_color=pygame.Color(255, 175, 127, 191), | 14 bg_color=pygame.Color(255, 175, 127, 191), |
15 color=pygame.Color(0, 0, 0), | 15 color=pygame.Color(0, 0, 0), |
16 border_color=pygame.Color(127, 15, 0)) | 16 border_color=pygame.Color(127, 15, 0)) |
17 | |
18 def prepare(self): | |
17 # Centre the widget | 19 # Centre the widget |
18 # Should this happen automatically in state? | 20 super(JimLabel, self).prepare() |
19 self.rect.center = (gd.constants.screen[0] / 2, | 21 self.rect.center = (self.gd.constants.screen[0] / 2, |
20 gd.constants.screen[1] / 2) | 22 self.gd.constants.screen[1] / 2) |