Add image button.
authorSimon Cross <hodgestar@gmail.com>
Wed, 2 Mar 2016 21:52:47 +0000 (23:52 +0200)
committerSimon Cross <hodgestar@gmail.com>
Wed, 2 Mar 2016 21:52:47 +0000 (23:52 +0200)
koperkapel/actors/buttons.py

index d6e395415f9bcfafc82872e1d04e202335629613..ac14f64d7cfc17f32d288afd27e193fca282d5a5 100644 (file)
@@ -1,13 +1,20 @@
 """ 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):