Mercurial > pyntnclick
view pyntnclick/widgets/imagebutton.py @ 831:70bdadf32dae pyntnclick
Remove text from cryo computer background
author | Neil Muller <neil@dip.sun.ac.za> |
---|---|
date | Tue, 29 Jan 2013 15:16:30 +0200 |
parents | 3a875256f795 |
children |
line wrap: on
line source
from pyntnclick.widgets.base import Button class ImageButtonWidget(Button): """An image that is also a button. Whatever next?""" def __init__(self, pos, gd, image, size=None): super(ImageButtonWidget, self).__init__(pos, gd, size) if not size: self.rect.size = image.get_rect().size self.image = image def draw(self, surface): if self.visible: surface.blit(self.image, self.rect)