# HG changeset patch # User Simon Cross # Date 1328991652 -7200 # Node ID a5f573002fb092a4ebadaf4992e31ce8551afb05 # Parent 660ef5793886a4c3d2d2f53d67ec2263f519b3b6 Pass rect around (we're going to be doing this alot). diff -r 660ef5793886 -r a5f573002fb0 pyntnclick/gamescreen.py --- a/pyntnclick/gamescreen.py Sat Feb 11 22:20:26 2012 +0200 +++ b/pyntnclick/gamescreen.py Sat Feb 11 22:20:52 2012 +0200 @@ -63,11 +63,11 @@ class StateWidget(Widget): - def __init__(self, rect): - Widget.__init__(self, Rect(0, 0, SCENE_SIZE[0], SCENE_SIZE[1])) + def __init__(self, rect, screen): + Widget.__init__(self, rect) self.screen = screen self.game = screen.game - self.detail = DetailWindow(screen) + self.detail = DetailWindow(rect, screen) def draw(self, surface): self.animate() @@ -140,8 +140,8 @@ class DetailWindow(Container): - def __init__(self, screen): - Container.__init__(self, Rect((0, 0) + screen.surface_size)) + def __init__(self, rect, screen): + Container.__init__(self, rect) self.image_rect = None self.screen = screen self.game = screen.game @@ -222,8 +222,9 @@ def start_game(self): self._clear_all() + rect = Rect((0, 0) + self.surface_size) self.game = self.create_initial_state() - self.state_widget = StateWidget(self) + self.state_widget = StateWidget(rect, self) self.container.add(self.state_widget) # XXX: self.popup_menu = PopupMenu(self)