🎨 Prettyfying

This commit is contained in:
NikolajDanger
2020-07-28 14:25:31 +02:00
parent b03fa25c11
commit e7234ee1b1

View File

@ -28,14 +28,18 @@ def drawImage(channel):
userHand = drawHand(value["hand"],False,value["busted"],value["blackjack"])
textWidth = fnt.getsize(key)[0]
table.paste(userHand,(32+(384*placement[x]),680),userHand)
textImage.text((32+(384*placement[x])+117-int(textWidth/2),1010),key,fill=(0,0,0), font=fnt)
textImage.text((32+(384*placement[x])+117-int(textWidth/2)-3,1010-3),key,fill=(0,0,0), font=fnt)
textImage.text((32+(384*placement[x])+117-int(textWidth/2)+3,1010-3),key,fill=(0,0,0), font=fnt)
textImage.text((32+(384*placement[x])+117-int(textWidth/2)-3,1010+3),key,fill=(0,0,0), font=fnt)
textImage.text((32+(384*placement[x])+117-int(textWidth/2)+3,1010+3),key,fill=(0,0,0), font=fnt)
textImage.text((32+(384*placement[x])+117-int(textWidth/2),1005),key,fill=(255,255,255), font=fnt)
table.save("resources/games/tables/blackjackTable"+channel+".png")
return
def drawHand(hand, dealer, busted, blackjack):
print(str(hand)+str(blackjack))
fnt = ImageFont.truetype('resources/futura-bold.ttf', 200)
fnt2 = ImageFont.truetype('resources/futura-bold.ttf', 120)
length = len(hand)
@ -67,7 +71,6 @@ def drawHand(hand, dealer, busted, blackjack):
textImage.text((int(w/2)-int(textWidth/2),430),"BUSTED",fill=(255,50,50), font=fnt)
elif blackjack:
textWidth = fnt2.getsize("BLACKJACK")[0]
print(textWidth)
textImage.text((int(w/2)-int(textWidth/2)-6,450-6),"BLACKJACK",fill=(0,0,0), font=fnt2)
textImage.text((int(w/2)-int(textWidth/2)+6,450-6),"BLACKJACK",fill=(0,0,0), font=fnt2)
textImage.text((int(w/2)-int(textWidth/2)-6,450+6),"BLACKJACK",fill=(0,0,0), font=fnt2)