Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge pull request #46 from piggybomb/master

new mouse cursor
  • Loading branch information...
commit 08a97cdecc785122532c02d55fb3fc47df23c2f1 2 parents f69ca05 + f80e524
Fred Shih elElmo authored
BIN  assets/art/cursor/mickey_mouse.png
BIN  resources/Border In Progress.png
BIN  resources/httpsnees.orgtoolsopenfrescobrowsertrunkGUIblueGradient.pngrev=259.png
BIN  resources/risk_board - Copy.png
11 risk/graphics/picasso.py
@@ -11,10 +11,14 @@
11 11
12 12 import risk
13 13 import risk.logger
  14 +import risk.graphics.assets.image
14 15
15 16 from risk.graphics.event import pump
16 17 from risk.graphics.assets.base import PicassoAsset
17 18 from risk.graphics.assets.text import TextAsset
  19 +from risk.graphics import assets
  20 +
  21 +MOUSE_CURSOR_LOCATION = 'assets/art/cursor/mickey_mouse.png'
18 22
19 23 def get_picasso(*args, **kwargs):
20 24 if not hasattr(get_picasso, 'picasso_instance'):
@@ -48,6 +52,7 @@ def __init__(self, background='', width=1920,
48 52
49 53 def run(self):
50 54 try:
  55 + pygame.mouse.set_visible(False)
51 56 while not self.ended:
52 57 self.draw_canvas()
53 58 self.clock.tick(self.fps)
@@ -59,6 +64,7 @@ def run(self):
59 64 def draw_canvas(self):
60 65 pump()
61 66 self.window.blit(self.background, (0, 0))
  67 +
62 68 # make a deep copy of layers first to avoid race condition where dict
63 69 # size can change during iteration. try to do it lockless, if we're
64 70 # still having issues, fix with mutex
@@ -74,8 +80,11 @@ def draw_canvas(self):
74 80 risk.logger.error("ignoring dictionary size change...")
75 81 fps_asset = self.get_fps_asset()
76 82 self.window.blit(fps_asset.draw(), fps_asset.get_coordinate())
  83 + x,y = pygame.mouse.get_pos()
  84 + mouse_cursor = assets.image.ImageAsset(x - 12, y - 8, MOUSE_CURSOR_LOCATION)
  85 + self.window.blit(mouse_cursor.draw(), mouse_cursor.get_coordinate())
77 86 pygame.display.flip()
78   -
  87 +
79 88 def add_asset(self, layer, asset):
80 89 try:
81 90 self.canvas[layer].add(asset)
6 sources.txt
@@ -2,6 +2,8 @@ sources:
2 2
3 3 risk map - http://shanjay.com/?p=114
4 4
5   -beige background - http://www.deluzions.net/blog/free-textures-worn-leather/
  5 +beige map background - http://www.deluzions.net/blog/free-textures-worn-leather/
6 6
7   -GUI border -
  7 +GUI border background - psdgraphics.com/file/textured-paper.jpg
  8 +
  9 +mickey mouse - http://www.snazzyspace.com/cursorsfolder/mickey-big-pointer.png

0 comments on commit 08a97cd

Please sign in to comment.
Something went wrong with that request. Please try again.