super(Cursor, self).__init__()
self._active = False
- def activate(self, name, group):
- self.image = loader.load_image('cursors', name + '.png')
+ def activate(self, name, group, transform=None):
+ if transform:
+ self.image = loader.load_image('cursors', name + '.png',
+ transform=transform)
+ else:
+ self.image = loader.load_image('cursors', name + '.png')
self.rect = self.image.get_rect()
self._active = True
group.empty()
self._cursor = Cursor()
self._cursor_group = RenderUpdates()
- def _set_cursor(self, name):
- self._cursor.activate(name, self._cursor_group)
+ def _set_cursor(self, name, transform=None):
+ self._cursor.activate(name, self._cursor_group, transform=transform)
def _unset_cursor(self):
self._cursor.deactivate(self._cursor_group)
from .loader import loader
from .constants import FONTS
+from .transforms import NullTransform
class Button(object):
class ImageButton(Button):
def __init__(self, *imgparts, **kwargs):
- self._img = loader.load_image(*imgparts)
+ transform = kwargs.pop("transform", NullTransform())
+ self._img = loader.load_image(*imgparts, transform=transform)
name = kwargs.get('name')
pos = kwargs.get('pos')
padding = kwargs.get('padding', 0)