Mercurial > pyntnclick
view gamelib/custom_widgets.py @ 730:eca4d2fc11a4 pyntnclick
Move game_logic_utils to pyntnclick
author | Stefano Rivera <stefano@rivera.za.net> |
---|---|
date | Tue, 15 Jan 2013 22:56:30 +0200 |
parents | efa58c92b304 |
children | bcc9277a23e6 |
line wrap: on
line source
"""Custom widgets for Suspened Sentence""" import pygame from pyntnclick.widgets.text import WrappedTextLabel class JimLabel(WrappedTextLabel): """Custom widget for JIM's speech""" def __init__(self, gd, mesg): rect = pygame.Rect((0, 0), (1, 1)) super(JimLabel, self).__init__(rect, gd, text=mesg, fontname='Monospace.ttf', fontsize=20, bg_color=pygame.Color(255, 175, 127, 191), color=pygame.Color(0, 0, 0), border_color=pygame.Color(127, 15, 0)) def prepare(self): # Centre the widget super(JimLabel, self).prepare() self.rect.center = (self.gd.constants.screen[0] / 2, self.gd.constants.screen[1] / 2)