Mercurial > pyntnclick
diff gamelib/gamescreen.py @ 106:da547e148532
Some (slightly) better cursor handling.
author | Jeremy Thurgood <firxen@gmail.com> |
---|---|
date | Tue, 24 Aug 2010 13:53:49 +0200 |
parents | 65976205fc2d |
children | 5213b45fcc7e |
line wrap: on
line diff
--- a/gamelib/gamescreen.py Tue Aug 24 11:57:06 2010 +0200 +++ b/gamelib/gamescreen.py Tue Aug 24 13:53:49 2010 +0200 @@ -20,12 +20,13 @@ from widgets import BoomLabel -class InventoryView(PaletteView): +class InventoryView(PaletteView, CursorWidget): sel_color = Color("yellow") sel_width = 2 def __init__(self, state, handbutton): + CursorWidget.__init__(self) PaletteView.__init__(self, (BUTTON_SIZE, BUTTON_SIZE), 1, 6, scrolling=True) self.state = state self.handbutton = handbutton @@ -37,6 +38,10 @@ 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 click_item(self, item_no, event): self.state.set_tool(self.state.inventory[item_no]) self.handbutton.unselect()