Mercurial > pyntnclick
diff gamelib/popupmenu.py @ 70:213e47dea4d0
Funkier cursor handling
author | Neil Muller <neil@dip.sun.ac.za> |
---|---|
date | Mon, 23 Aug 2010 20:54:04 +0200 |
parents | d4bbb26099cc |
children | c76f2fad2af5 |
line wrap: on
line diff
--- a/gamelib/popupmenu.py Mon Aug 23 20:50:36 2010 +0200 +++ b/gamelib/popupmenu.py Mon Aug 23 20:54:04 2010 +0200 @@ -3,9 +3,25 @@ # Popup menu for the game screen from constants import BUTTON_SIZE +from cursor import CursorWidget from albow.menu import Menu +from albow.controls import Button from albow.resource import get_font +from pygame.rect import Rect + +class PopupMenuButton(Button, CursorWidget): + + def __init__(self, text, action): + Button.__init__(self, text, action) + + self.font = get_font(16, 'Vera.ttf') + self.set_rect(Rect(0, 0, BUTTON_SIZE, BUTTON_SIZE)) + self.margin = (BUTTON_SIZE - self.font.get_linesize()) / 2 + + def get_cursor(self, event): + # Draw standard arrow, not the sprite cursor + return None class PopupMenu(Menu):