diff gamelib/cursors.py @ 162:fa57868123d7

Basic cursor support
author Neil Muller <drnlmuller@gmail.com>
date Thu, 03 Sep 2009 22:19:34 +0000
parents
children bca2f4396de8
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gamelib/cursors.py	Thu Sep 03 22:19:34 2009 +0000
@@ -0,0 +1,23 @@
+"""Data for the in game cursors"""
+
+import pygame
+
+import data
+
+
+cursors = {
+        'arrow' : pygame.cursors.arrow,
+        'select' : pygame.cursors.broken_x,
+        }
+
+for tag, filename in [
+        ('chicken', 'cursors/chkn.xbm'),
+        ('rifle', 'cursors/equip_rifle.xbm'),
+        ('knife', 'cursors/equip_knife.xbm'),
+        ]:
+    path = data.filepath(filename)
+    # pygame 1.8 needs the file twice to do the right thing
+    # XXX: check behaviour with pygame 1.9
+    cursors[tag] = pygame.cursors.load_xbm(path, path)
+
+