3 from pgzero.actor import Actor
4 from pgzero.ptext import getsurf
5 from .surf import SurfActor
8 class ImageButton(Actor):
9 def __init__(self, *args, action=None, **kwargs):
10 super().__init__(*args, **kwargs)
14 class TextButton(SurfActor):
15 def __init__(self, text, action=None, **kwargs):
16 self.text(text, **kwargs)
17 super().__init__(self._surf)
21 self.text(self._text, owidth=2, ocolor="white", color="black")
26 def text(self, text, **kw):
28 self._text_kwargs = kw
29 self.surf = getsurf(text, **kw)