Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #46 from piggybomb/master

new mouse cursor
  • Loading branch information...
commit 08a97cdecc785122532c02d55fb3fc47df23c2f1 2 parents f69ca05 + f80e524
@elElmo authored
View
BIN  assets/art/cursor/mickey_mouse.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  resources/Border In Progress.png
Deleted file not rendered
View
BIN  resources/httpsnees.orgtoolsopenfrescobrowsertrunkGUIblueGradient.pngrev=259.png
Deleted file not rendered
View
BIN  resources/risk_board - Copy.png
Deleted file not rendered
View
11 risk/graphics/picasso.py
@@ -11,10 +11,14 @@
import risk
import risk.logger
+import risk.graphics.assets.image
from risk.graphics.event import pump
from risk.graphics.assets.base import PicassoAsset
from risk.graphics.assets.text import TextAsset
+from risk.graphics import assets
+
+MOUSE_CURSOR_LOCATION = 'assets/art/cursor/mickey_mouse.png'
def get_picasso(*args, **kwargs):
if not hasattr(get_picasso, 'picasso_instance'):
@@ -48,6 +52,7 @@ def __init__(self, background='', width=1920,
def run(self):
try:
+ pygame.mouse.set_visible(False)
while not self.ended:
self.draw_canvas()
self.clock.tick(self.fps)
@@ -59,6 +64,7 @@ def run(self):
def draw_canvas(self):
pump()
self.window.blit(self.background, (0, 0))
+
# make a deep copy of layers first to avoid race condition where dict
# size can change during iteration. try to do it lockless, if we're
# still having issues, fix with mutex
@@ -74,8 +80,11 @@ def draw_canvas(self):
risk.logger.error("ignoring dictionary size change...")
fps_asset = self.get_fps_asset()
self.window.blit(fps_asset.draw(), fps_asset.get_coordinate())
+ x,y = pygame.mouse.get_pos()
+ mouse_cursor = assets.image.ImageAsset(x - 12, y - 8, MOUSE_CURSOR_LOCATION)
+ self.window.blit(mouse_cursor.draw(), mouse_cursor.get_coordinate())
pygame.display.flip()
-
+
def add_asset(self, layer, asset):
try:
self.canvas[layer].add(asset)
View
6 sources.txt
@@ -2,6 +2,8 @@ sources:
risk map - http://shanjay.com/?p=114
-beige background - http://www.deluzions.net/blog/free-textures-worn-leather/
+beige map background - http://www.deluzions.net/blog/free-textures-worn-leather/
-GUI border -
+GUI border background - psdgraphics.com/file/textured-paper.jpg
+
+mickey mouse - http://www.snazzyspace.com/cursorsfolder/mickey-big-pointer.png
Please sign in to comment.
Something went wrong with that request. Please try again.