Skip to content

Commit

Permalink
work towards new hud graphics
Browse files Browse the repository at this point in the history
  • Loading branch information
BinkyToo committed Sep 13, 2014
1 parent ee9e5e2 commit 8342fa4
Show file tree
Hide file tree
Showing 9 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion HUD.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def draw(self, region, quantity):
fittedimage = self.image.get_rect().fit(imageregion)
self.window.blit(pygame.transform.scale(self.image, fittedimage.size), fittedimage)
string = self.stringfunc(quantity, self.total)
newTextBox.Draw(self.window, string, region, colour=BLACK, size=18, ycentred=False)
newTextBox.Draw(self.window, string, region, colour=BLACK, size=22, ycentred=False)

class MinimapWidget:
'''Widget to display a small map of the world'''
Expand Down Expand Up @@ -90,3 +90,4 @@ def splash(message):
splash("You found all the coins!")
else:
splash("What happened here?")

Binary file added fonts/MorrisRomanBlack.ttf
Binary file not shown.
Binary file added hud/rockwall.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added hud/rockwall.xcf
Binary file not shown.
Binary file added hud/woodenrule-horiz.xcf
Binary file not shown.
Binary file added hud/woodenrule.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added hud/woodenrule.xcf
Binary file not shown.
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import sys
import time

WINDOWSIZE = (740, 480)
WINDOWSIZE = (800, 480)
window = pygame.display.set_mode(WINDOWSIZE, pygame.RESIZABLE)

from HUD import HUD
Expand Down
4 changes: 2 additions & 2 deletions newTextBox.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@

defaultSize = 12
defaultColour = WHITE
defaultFont = 'Dejavu Sans'
defaultFont = "./fonts/morris_roman/MorrisRomanBlack.ttf" #'Dejavu Sans'

def Draw(drawSurface, textString, rect, colour=defaultColour, size=defaultSize, font=defaultFont, xcentred=True, ycentred=True):
font = pygame.font.SysFont(font, size)
font = pygame.font.Font(font, size)
textBitmap = font.render(textString, True, colour)
xoffset = 0
yoffset = rect.height-(size*1.25) # Clunky - FIXME
Expand Down

0 comments on commit 8342fa4

Please sign in to comment.