Mercurial > boomslang
comparison 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 |
comparison
equal
deleted
inserted
replaced
295:4a9f29bae9b0 | 296:86e3d5dd7fa6 |
---|---|
77 | 77 |
78 def set_thing(self, thing): | 78 def set_thing(self, thing): |
79 self.image = get_image(thing.folder, self._image_name) | 79 self.image = get_image(thing.folder, self._image_name) |
80 self.rect = Rect(self._pos, self.image.get_size()) | 80 self.rect = Rect(self._pos, self.image.get_size()) |
81 self.interact_rect = self.rect | 81 self.interact_rect = self.rect |
82 | |
83 | |
84 class InteractImageRect(InteractImage): | |
85 def __init__(self, x, y, image_name, r_x, r_y, r_w, r_h): | |
86 super(InteractImageRect, self).__init__(x, y, image_name) | |
87 self._r_pos = (r_x, r_y) | |
88 self._r_size = (r_w, r_h) | |
89 | |
90 def set_thing(self, thing): | |
91 super(InteractImageRect, self).set_thing(thing) | |
92 self.interact_rect = Rect(self._r_pos, self._r_size) | |
82 | 93 |
83 | 94 |
84 class InteractAnimated(Interact): | 95 class InteractAnimated(Interact): |
85 """Interactive with an animation rather than an image""" | 96 """Interactive with an animation rather than an image""" |
86 | 97 |