Mercurial > pyntnclick
comparison gamelib/gamescreen.py @ 526:a984cf27b527
Defer some resource loading until it's actually necessary.
author | Jeremy Thurgood <firxen@gmail.com> |
---|---|
date | Wed, 08 Sep 2010 17:33:07 +0200 |
parents | 92782d1ca7be |
children | 0ce08d5e2acb |
comparison
equal
deleted
inserted
replaced
525:821b322e903b | 526:a984cf27b527 |
---|---|
114 else: | 114 else: |
115 self._mouse_move(mouse.get_pos()) | 115 self._mouse_move(mouse.get_pos()) |
116 | 116 |
117 def show_detail(self, detail): | 117 def show_detail(self, detail): |
118 self.clear_detail() | 118 self.clear_detail() |
119 w, h = self.state.set_current_detail(detail) | 119 detail_obj = self.state.set_current_detail(detail) |
120 self.detail.set_image_rect(Rect(0, 0, w, h)) | 120 self.detail.set_image_rect(Rect((0, 0), detail_obj.get_detail_size())) |
121 self.add_centered(self.detail) | 121 self.add_centered(self.detail) |
122 self.state.do_enter_detail() | 122 self.state.do_enter_detail() |
123 | 123 |
124 def clear_detail(self): | 124 def clear_detail(self): |
125 """Hide the detail view""" | 125 """Hide the detail view""" |