changeset 52:7a977f8f433a

Better looking menu button
author Neil Muller <neil@dip.sun.ac.za>
date Mon, 23 Aug 2010 12:46:51 +0200
parents 3417cf0e8795
children 3d460c1274ee
files gamelib/gamescreen.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/gamelib/gamescreen.py	Mon Aug 23 12:18:03 2010 +0200
+++ b/gamelib/gamescreen.py	Mon Aug 23 12:46:51 2010 +0200
@@ -9,6 +9,7 @@
 from pygame import Rect
 from pygame.locals import BLEND_ADD
 from albow.screen import Screen
+from albow.resource import get_font
 from albow.controls import Button, Label, Widget
 from albow.layout import Column
 from albow.palette_view import PaletteView
@@ -76,8 +77,11 @@
             Button('Use titanium_leg', action = lambda: self.state.scenes['cryo'].things['cryo.door'].interact(self.state.items['titanium_leg'])),
             ], align='l', spacing=20)
         self.add_centered(menu)
-        self.menubutton = Button('M', action=self.main_menu)
+        self.menubutton = Button('Menu', action=self.main_menu)
+        self.menubutton.font = get_font(16, 'Vera.ttf')
+        self.menubutton.set_rect(Rect(0, 0, 50, 50))
         self.menubutton.bottomleft = self.bottomleft
+        self.menubutton.margin = (50 - self.menubutton.font.get_linesize()) / 2
         self.add(self.menubutton)
         self.handbutton = HandButton(action=self.hand_pressed)
         self.handbutton.bottomleft = self.bottomleft