Mercurial > pyntnclick
view gamelib/custom_widgets.py @ 686:48f68ae7d454 pyntnclick
Throw out more old stuff. Fix animation support
author | Neil Muller <neil@dip.sun.ac.za> |
---|---|
date | Mon, 13 Feb 2012 11:36:32 +0200 |
parents | 497b6d7c55e7 |
children | c8b683dd56d3 |
line wrap: on
line source
"""Custom widgets for Suspened Sentence""" import pygame from pyntnclick.widgets.text import ModalWrappedTextLabel class JimLabel(ModalWrappedTextLabel): """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)) # Centre the widget # Should this happen automatically in state? self.rect.center = (gd.constants.screen[0] / 2, gd.constants.screen[1] / 2)