diff gamelib/cursor.py @ 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 3476e8f3b100
children 0e8487038834
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