Skip to content

Commit

Permalink
Some minor graphics work
Browse files Browse the repository at this point in the history
  • Loading branch information
frgorp committed Apr 1, 2013
1 parent 64b1885 commit f845214
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
1 change: 1 addition & 0 deletions risk/graphics/assets/base.py
Expand Up @@ -10,6 +10,7 @@
YELLOW = (204, 204, 0)
PURPLE = (102, 0, 102)
ORANGE = (204, 102, 0)
LIGHT_BROWN = (238, 223, 204)

class PicassoAsset(Surface):
def __init__(self, surface, x, y):
Expand Down
15 changes: 8 additions & 7 deletions risk/graphics/assets/image.py
Expand Up @@ -5,10 +5,11 @@

class ImageAsset(PicassoAsset):
def __init__(self, x, y, path, scale_x=1.0, scale_y=1.0):
self.path = path
self.surface = pygame.image.load(path).convert_alpha()
if scale_x != 1 or scale_y != 1:
self.surface = pygame.transform.scale(self.surface,
(int(self.surface.get_width() * scale_x),
int(self.surface.get_height() * scale_y)))
PicassoAsset.__init__(self, self.surface, x, y)
pass
#self.path = path
#self.surface = pygame.image.load(path).convert_alpha()
#if scale_x != 1 or scale_y != 1:
# self.surface = pygame.transform.scale(self.surface,
# (int(self.surface.get_width() * scale_x),
# int(self.surface.get_height() * scale_y)))
#PicassoAsset.__init__(self, self.surface, x, y)
4 changes: 2 additions & 2 deletions risk/graphics/graphics.py
Expand Up @@ -144,7 +144,7 @@ def initialize_other_graphic_assets(picasso, game_master):
def add_buttons(picasso):
datastore = Datastore()
next_button = assets.clickable.ClickableAsset(
1000, 500, 100, 100, 'NEXT')
1000, 635, 120, 65, 'NEXT')
datastore.add_entry('next', next_button, 'buttons')

for button in datastore.get_storage('buttons').values():
Expand All @@ -154,7 +154,7 @@ def add_overlay(picasso):
datastore = Datastore()
overlay = assets.image.ImageAsset(0, 0, DEFAULT_OVERLAY)
datastore.add_entry('overlay', overlay)
picasso.add_asset('999_overlay', overlay)
#picasso.add_asset('0_overlay', overlay)

def show_human_player(game_master):
layer = 3
Expand Down

0 comments on commit f845214

Please sign in to comment.