""" Buttons. """
+from pgzero.actor import Actor
from pgzero.ptext import getsurf
from .surf import SurfActor
+class ImageButton(Actor):
+ def __init__(self, *args, action=None, **kwargs):
+ super().__init__(*args, **kwargs)
+ self.action = action
+
+
class TextButton(SurfActor):
def __init__(self, text, action=None, **kwargs):
self.text(text, **kwargs)
- super(TextButton, self).__init__(self._surf)
+ super().__init__(self._surf)
self.action = action
def select(self):