Skip to content

Commit

Permalink
- added workaround to NoneType bug in pgzero by setting a default font.
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveClement committed Jun 25, 2017
1 parent d7d6bf7 commit e7854d4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion 012_1stText.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@

def draw():
screen.draw.text(
': {0}'.format(score),
' : {0}'.format(score),
color=MAIN_COLOR,
center=(alienEmoji.width + (WIDTH/4) - 20, alienEmoji.height/2),
sysfontname='arial',
fontsize=48
)
alienEmoji.draw()
2 changes: 2 additions & 0 deletions 019_RectFollowsMouseText.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,15 @@ def draw():
screen.draw.text(
'mouseX: {0} mouseY: {1}'.format(mousePos[0], mousePos[1]),
center=((WIDTH/2), 20),
sysfontname='arial',
fontsize=48,
color=YELLOW,
)

screen.draw.text(
'{}'.format(mousePos),
center=mousePos,
sysfontname='arial',
fontsize=mouseFont,
color=PINK,
)
Expand Down

0 comments on commit e7854d4

Please sign in to comment.