Mercurial > sypikslang
diff gamelib/gui.py @ 110:ff7c953502d5
Auto-downsize fonts on BigButtons that are too large.
author | Simon Cross <hodgestar@gmail.com> |
---|---|
date | Wed, 09 May 2012 22:37:07 +0200 |
parents | 22b65c943712 |
children | abbceec3cc8b |
line wrap: on
line diff
--- a/gamelib/gui.py Wed May 09 22:03:07 2012 +0200 +++ b/gamelib/gui.py Wed May 09 22:37:07 2012 +0200 @@ -1,7 +1,7 @@ from pygame import image from gamelib import data -from gamelib.gui_base import Drawable, TextButton, font_large +from gamelib.gui_base import Drawable, TextButton, font_auto class ImageDrawable(Drawable): @@ -20,7 +20,7 @@ BG_IMAGE_NORMAL = image.load(data.filepath('images/button_normal.png')) BG_IMAGE_DOWN = image.load(data.filepath('images/button_down.png')) - def __init__(self, pos, text, font=font_large, shadow=True): + def __init__(self, pos, text, font=font_auto, shadow=True): rect1 = (0, 0, self.WIDTH, self.HEIGHT) n = ImageDrawable(rect1, self.BG_IMAGE_NORMAL) d = ImageDrawable(rect1, self.BG_IMAGE_DOWN)