annotate gamelib/cursors.py @ 496:bf90a2948e34

Basic snapshot support in save games added.
author Simon Cross <hodgestar@gmail.com>
date Wed, 25 Nov 2009 23:15:56 +0000
parents 71f5897ac5ef
children
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,
272
cade64404997 Use (wrecking) ball for smashing down trees.
Simon Cross <hodgestar@gmail.com>
parents: 258
diff changeset
11 'ball': pygame.cursors.ball,
162
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
fa57868123d7 Basic cursor support
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
14 for tag, filename in [
fa57868123d7 Basic cursor support
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
15 ('chicken', 'cursors/chkn.xbm'),
258
d564ae258471 Add sell xbm cursor.
Simon Cross <hodgestar@gmail.com>
parents: 256
diff changeset
16 ('sell', 'cursors/sell_cursor.xbm'),
378
71f5897ac5ef Fences are now buildings, with appropriate (but ugly) UI changes.
Jeremy Thurgood <firxen@gmail.com>
parents: 272
diff changeset
17 ('repair', 'cursors/repair_cursor.xbm'),
162
fa57868123d7 Basic cursor support
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
18 ]:
fa57868123d7 Basic cursor support
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
19 path = data.filepath(filename)
fa57868123d7 Basic cursor support
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
20 # pygame 1.8 needs the file twice to do the right thing
fa57868123d7 Basic cursor support
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
21 # XXX: check behaviour with pygame 1.9
fa57868123d7 Basic cursor support
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
22 cursors[tag] = pygame.cursors.load_xbm(path, path)
fa57868123d7 Basic cursor support
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
23
fa57868123d7 Basic cursor support
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
24