annotate gamelib/cursors.py @ 258:d564ae258471

Add sell xbm cursor.
author Simon Cross <hodgestar@gmail.com>
date Sat, 05 Sep 2009 13:11:55 +0000
parents bca2f4396de8
children cade64404997
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
162
fa57868123d7 Basic cursor support
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
1 """Data for the in game cursors"""
fa57868123d7 Basic cursor support
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
2
fa57868123d7 Basic cursor support
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
3 import pygame
fa57868123d7 Basic cursor support
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
4
fa57868123d7 Basic cursor support
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
5 import data
fa57868123d7 Basic cursor support
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
6
fa57868123d7 Basic cursor support
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
7
fa57868123d7 Basic cursor support
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
8 cursors = {
fa57868123d7 Basic cursor support
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
9 'arrow' : pygame.cursors.arrow,
fa57868123d7 Basic cursor support
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
10 'select' : pygame.cursors.broken_x,
fa57868123d7 Basic cursor support
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
11 }
fa57868123d7 Basic cursor support
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
12
fa57868123d7 Basic cursor support
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
13 for tag, filename in [
fa57868123d7 Basic cursor support
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
14 ('chicken', 'cursors/chkn.xbm'),
258
d564ae258471 Add sell xbm cursor.
Simon Cross <hodgestar@gmail.com>
parents: 256
diff changeset
15 ('sell', 'cursors/sell_cursor.xbm'),
162
fa57868123d7 Basic cursor support
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
16 ]:
fa57868123d7 Basic cursor support
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
17 path = data.filepath(filename)
fa57868123d7 Basic cursor support
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
18 # pygame 1.8 needs the file twice to do the right thing
fa57868123d7 Basic cursor support
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
19 # XXX: check behaviour with pygame 1.9
fa57868123d7 Basic cursor support
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
20 cursors[tag] = pygame.cursors.load_xbm(path, path)
fa57868123d7 Basic cursor support
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
21
fa57868123d7 Basic cursor support
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
22