Mercurial > boomslang
changeset 401:92029c76b687
Different toolbar colour and remove highlighted cursor outside scene widget.
author | Jeremy Thurgood <firxen@gmail.com> |
---|---|
date | Sat, 28 Aug 2010 21:30:15 +0200 |
parents | 0fd5796a1562 |
children | 2090b2bc13e4 |
files | gamelib/cursor.py gamelib/gamescreen.py |
diffstat | 2 files changed, 7 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/gamelib/cursor.py Sat Aug 28 21:28:37 2010 +0200 +++ b/gamelib/cursor.py Sat Aug 28 21:30:15 2010 +0200 @@ -5,11 +5,15 @@ from albow.resource import get_image from albow.widget import Widget from pygame.sprite import Sprite, RenderUpdates +from pygame.rect import Rect import pygame import pygame.color import pygame.cursors import pygame.mouse +from gamelib.constants import SCENE_SIZE + + class CursorSprite(Sprite): "A Sprite that follows the Cursor" @@ -102,6 +106,8 @@ cls._cursor_group.add(cls.cursor) def cursor_highlight(self): + if not Rect((0, 0), SCENE_SIZE).collidepoint(pygame.mouse.get_pos()): + return False if self.screen.state.highlight_override: return True current_thing = self.screen.state.current_thing
--- a/gamelib/gamescreen.py Sat Aug 28 21:28:37 2010 +0200 +++ b/gamelib/gamescreen.py Sat Aug 28 21:30:15 2010 +0200 @@ -171,6 +171,7 @@ for item in items: item.height = BUTTON_SIZE Row.__init__(self, items, spacing=0, width=SCREEN[0]) + self.bg_color = (127, 127, 127) class GameScreen(Screen, CursorWidget):