fix hangman error if display string empty

This commit is contained in:
interfisch 2017-10-26 23:51:09 +02:00
parent 7d9bf4f7fb
commit f59346f307
1 changed files with 4 additions and 3 deletions

View File

@ -262,9 +262,10 @@ class Hangman(object):
#for i in range(0,len(s2)):
# draw.text((fo_word2[0]+i*5, fo_word2[1]), s2[i], font=font, fill=C_TEXT)
draw.text(self._fo_word, s1.upper(), font=font, fill=C_TEXT)
draw.text(self._fo_word2, s2.upper(), font=font, fill=C_TEXT)
if (len(s1)>0):
draw.text(self._fo_word, s1.upper(), font=font, fill=C_TEXT)
if (len(s2)>0):
draw.text(self._fo_word2, s2.upper(), font=font, fill=C_TEXT)
def _drawLoseScreen(self,draw):
self._drawGameScreen(draw)