Mercurial > boomslang
comparison gamelib/gamescreen.py @ 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 | 13d8cb1d5962 |
comparison
equal
deleted
inserted
replaced
107:5213b45fcc7e | 108:ab11689aec36 |
---|---|
36 | 36 |
37 def draw_item(self, surface, item_no, rect): | 37 def draw_item(self, surface, item_no, rect): |
38 item_image = self.state.inventory[item_no].get_inventory_image() | 38 item_image = self.state.inventory[item_no].get_inventory_image() |
39 surface.blit(item_image, rect, None, BLEND_ADD) | 39 surface.blit(item_image, rect, None, BLEND_ADD) |
40 | 40 |
41 def draw(self, surface): | 41 def draw_over(self, surface): |
42 PaletteView.draw(self, surface) | 42 PaletteView.draw_over(self, surface) |
43 CursorWidget.draw(self, surface) | 43 CursorWidget.draw_over(self, surface) |
44 | 44 |
45 def click_item(self, item_no, event): | 45 def click_item(self, item_no, event): |
46 self.state.set_tool(self.state.inventory[item_no]) | 46 self.state.set_tool(self.state.inventory[item_no]) |
47 self.handbutton.unselect() | 47 self.handbutton.unselect() |
48 | 48 |
64 self.border_width = 1 | 64 self.border_width = 1 |
65 self.border_color = (0, 0, 0) | 65 self.border_color = (0, 0, 0) |
66 self.bg_color = (127, 127, 127) | 66 self.bg_color = (127, 127, 127) |
67 self.fg_color = (0, 0, 0) | 67 self.fg_color = (0, 0, 0) |
68 | 68 |
69 def draw(self, surface): | 69 def draw_over(self, surface): |
70 BoomLabel.draw(self, surface) | 70 CursorWidget.draw_over(self, surface) |
71 CursorWidget.draw(self, surface) | |
72 | 71 |
73 def mouse_down(self, event): | 72 def mouse_down(self, event): |
74 self.dismiss() | 73 self.dismiss() |
75 | 74 |
76 | 75 |
80 CursorWidget.__init__(self, Rect(0, 0, SCENE_SIZE[0], SCENE_SIZE[1])) | 79 CursorWidget.__init__(self, Rect(0, 0, SCENE_SIZE[0], SCENE_SIZE[1])) |
81 self.state = state | 80 self.state = state |
82 | 81 |
83 def draw(self, surface): | 82 def draw(self, surface): |
84 self.state.draw(surface) | 83 self.state.draw(surface) |
85 CursorWidget.draw(self, surface) | |
86 | 84 |
87 def mouse_down(self, event): | 85 def mouse_down(self, event): |
88 result = self.state.interact(event.pos) | 86 result = self.state.interact(event.pos) |
89 if result: | 87 if result: |
90 if result.sound: | 88 if result.sound: |
106 CursorWidget.mouse_move(self, event) | 104 CursorWidget.mouse_move(self, event) |
107 | 105 |
108 | 106 |
109 class DetailWindow(CursorWidget): | 107 class DetailWindow(CursorWidget): |
110 def __init__(self, state): | 108 def __init__(self, state): |
111 Widget.__init__(self, Rect(0, 0, SCENE_SIZE[0], SCENE_SIZE[1])) | 109 CursorWidget.__init__(self, Rect(0, 0, SCENE_SIZE[0], SCENE_SIZE[1])) |
112 self.state = state | 110 self.state = state |
113 self.draw_area = Rect(0, 0, 300, 300) | 111 self.draw_area = Rect(0, 0, 300, 300) |
114 self.draw_area.center = self.center | 112 self.draw_area.center = self.center |
115 | 113 |
116 def draw(self, surface): | 114 def draw(self, surface): |