Add reset tool button
authorNeil <neil@dip.sun.ac.za>
Thu, 8 Sep 2016 19:05:01 +0000 (21:05 +0200)
committerNeil <neil@dip.sun.ac.za>
Thu, 8 Sep 2016 19:05:01 +0000 (21:05 +0200)
data/images/32/default_cursor.png [new file with mode: 0644]
sources/bitmap/mouse_pointer_wolfram_es_01.png [new file with mode: 0644]
sources/bitmap/sources.txt
tabakrolletjie/scenes/day.py

diff --git a/data/images/32/default_cursor.png b/data/images/32/default_cursor.png
new file mode 100644 (file)
index 0000000..3219c65
Binary files /dev/null and b/data/images/32/default_cursor.png differ
diff --git a/sources/bitmap/mouse_pointer_wolfram_es_01.png b/sources/bitmap/mouse_pointer_wolfram_es_01.png
new file mode 100644 (file)
index 0000000..4b74c4f
Binary files /dev/null and b/sources/bitmap/mouse_pointer_wolfram_es_01.png differ
index 7cb1aa5f2f39e89585779392e7f5056741a9a04a..8ddf1ff513eb89f2d4a897167df6146be17b3c2b 100644 (file)
@@ -6,3 +6,9 @@ https://commons.wikimedia.org/wiki/File:Galets.jpg
 
 Shrub texture:
 https://commons.wikimedia.org/wiki/File:Gew%C3%B6hnlicher_Buchsbaum,_Buxus_sempervirens_.JPG
+
+Pointer image: data/images/32/default_cursor.png
+Based on mouse_pointer_wolfram_es_01.png
+(image cropped and shrunk to 32x32)
+From OpenClipArt: http://www.openclipart.org
+LICENSE: Public Domain
index e3c5f727756303372def9c5927c8b0cfd7691f23..8ac0ed170ac40368bc77705a071ad8bfd7d07e61 100644 (file)
@@ -24,6 +24,8 @@ class DayScene(BaseScene):
         self._tools = [
             ImageButton('32', 'seed.png', name='seed',
                         pos=(50, SCREEN_SIZE[1] - 40)),
+            ImageButton('32', 'default_cursor.png', name='reset tool',
+                        pos=(SCREEN_SIZE[0] - 50, SCREEN_SIZE[1] - 40)),
         ]
 
     def exit(self, gamestate):
@@ -53,7 +55,10 @@ class DayScene(BaseScene):
                 for tool in self._tools:
                     if tool.pressed(ev):
                         print 'tool', tool.name
-                        self._set_cursor(tool.name)
+                        if tool.name == 'reset tool':
+                            self._unset_cursor()
+                        else:
+                            self._set_cursor(tool.name)
                         return
                 # Not tool, so check lights
                 self._lights.toggle_nearest(ev.pos, surfpos=True)