diff gamelib/scenes/scene_widgets.py @ 296:86e3d5dd7fa6

Added detergent bottle Item and InteractImageRect class
author Stefano Rivera <stefano@rivera.za.net>
date Sat, 28 Aug 2010 00:28:18 +0200
parents 80cb577e38f2
children 125cb389ab90
line wrap: on
line diff
--- a/gamelib/scenes/scene_widgets.py	Sat Aug 28 00:25:26 2010 +0200
+++ b/gamelib/scenes/scene_widgets.py	Sat Aug 28 00:28:18 2010 +0200
@@ -81,6 +81,17 @@
         self.interact_rect = self.rect
 
 
+class InteractImageRect(InteractImage):
+    def __init__(self, x, y, image_name, r_x, r_y, r_w, r_h):
+        super(InteractImageRect, self).__init__(x, y, image_name)
+        self._r_pos = (r_x, r_y)
+        self._r_size = (r_w, r_h)
+
+    def set_thing(self, thing):
+        super(InteractImageRect, self).set_thing(thing)
+        self.interact_rect = Rect(self._r_pos, self._r_size)
+
+
 class InteractAnimated(Interact):
     """Interactive with an animation rather than an image"""