From: Neil Date: Thu, 8 Sep 2016 19:05:01 +0000 (+0200) Subject: Add reset tool button X-Git-Tag: tabakrolletjie-v1.0.0~180 X-Git-Url: https://git.ctpug.org.za/?p=tabakrolletjie.git;a=commitdiff_plain;h=9596250b3a3507539e1578881ec470f112cc5970 Add reset tool button --- diff --git a/data/images/32/default_cursor.png b/data/images/32/default_cursor.png new file mode 100644 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 index 0000000..4b74c4f Binary files /dev/null and b/sources/bitmap/mouse_pointer_wolfram_es_01.png differ diff --git a/sources/bitmap/sources.txt b/sources/bitmap/sources.txt index 7cb1aa5..8ddf1ff 100644 --- a/sources/bitmap/sources.txt +++ b/sources/bitmap/sources.txt @@ -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 diff --git a/tabakrolletjie/scenes/day.py b/tabakrolletjie/scenes/day.py index e3c5f72..8ac0ed1 100644 --- a/tabakrolletjie/scenes/day.py +++ b/tabakrolletjie/scenes/day.py @@ -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)