changeset 108:ab11689aec36

Cursor uses draw_over() rather than draw().
author Jeremy Thurgood <firxen@gmail.com>
date Tue, 24 Aug 2010 14:17:09 +0200
parents 5213b45fcc7e
children 66898d810247
files gamelib/cursor.py gamelib/gamescreen.py
diffstat 2 files changed, 8 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/gamelib/cursor.py	Tue Aug 24 14:07:07 2010 +0200
+++ b/gamelib/cursor.py	Tue Aug 24 14:17:09 2010 +0200
@@ -28,7 +28,8 @@
         self._cursor_group = RenderUpdates()
         self._cursor_name = ''
 
-    def draw(self, _surface):
+    def draw_over(self, _surface):
+        Widget.draw_over(self, _surface)
         surface = self.get_root().surface
         if self.rect.collidepoint(mouse.get_pos()):
             cursor = self.get_sprite_cursor()
--- a/gamelib/gamescreen.py	Tue Aug 24 14:07:07 2010 +0200
+++ b/gamelib/gamescreen.py	Tue Aug 24 14:17:09 2010 +0200
@@ -38,9 +38,9 @@
         item_image = self.state.inventory[item_no].get_inventory_image()
         surface.blit(item_image, rect, None, BLEND_ADD)
 
-    def draw(self, surface):
-        PaletteView.draw(self, surface)
-        CursorWidget.draw(self, surface)
+    def draw_over(self, surface):
+        PaletteView.draw_over(self, surface)
+        CursorWidget.draw_over(self, surface)
 
     def click_item(self, item_no, event):
         self.state.set_tool(self.state.inventory[item_no])
@@ -66,9 +66,8 @@
         self.bg_color = (127, 127, 127)
         self.fg_color = (0, 0, 0)
 
-    def draw(self, surface):
-        BoomLabel.draw(self, surface)
-        CursorWidget.draw(self, surface)
+    def draw_over(self, surface):
+        CursorWidget.draw_over(self, surface)
 
     def mouse_down(self, event):
         self.dismiss()
@@ -82,7 +81,6 @@
 
     def draw(self, surface):
         self.state.draw(surface)
-        CursorWidget.draw(self, surface)
 
     def mouse_down(self, event):
         result = self.state.interact(event.pos)
@@ -108,7 +106,7 @@
 
 class DetailWindow(CursorWidget):
     def __init__(self, state):
-        Widget.__init__(self, Rect(0, 0, SCENE_SIZE[0], SCENE_SIZE[1]))
+        CursorWidget.__init__(self, Rect(0, 0, SCENE_SIZE[0], SCENE_SIZE[1]))
         self.state = state
         self.draw_area = Rect(0, 0, 300, 300)
         self.draw_area.center = self.center