🎨 fixes text size
This commit is contained in:
@@ -7,6 +7,7 @@ def drawImage(channel):
|
|||||||
data = json.load(f)
|
data = json.load(f)
|
||||||
|
|
||||||
fnt = ImageFont.truetype('resources/futura-bold.ttf', 50)
|
fnt = ImageFont.truetype('resources/futura-bold.ttf', 50)
|
||||||
|
fntSmol = ImageFont.truetype('resources/futura-bold.ttf', 40)
|
||||||
|
|
||||||
table = Image.open("resources/games/blackjackTable.png")
|
table = Image.open("resources/games/blackjackTable.png")
|
||||||
placement = [2,1,3,0,4]
|
placement = [2,1,3,0,4]
|
||||||
@@ -35,11 +36,19 @@ def drawImage(channel):
|
|||||||
table.paste(userHand,(32+(384*placement[x]),680),userHand)
|
table.paste(userHand,(32+(384*placement[x]),680),userHand)
|
||||||
|
|
||||||
textWidth = fnt.getsize(key)[0]
|
textWidth = fnt.getsize(key)[0]
|
||||||
textImage.text((32+(384*placement[x])+117-int(textWidth/2)-3,1010-3),key,fill=(0,0,0), font=fnt)
|
if textWidth < 360:
|
||||||
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)+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)
|
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)
|
||||||
|
else:
|
||||||
|
textWidth = fntSmol.getsize(key)[0]
|
||||||
|
textImage.text((32+(384*placement[x])+117-int(textWidth/2)-3,1010-3),key,fill=(0,0,0), font=fntSmol)
|
||||||
|
textImage.text((32+(384*placement[x])+117-int(textWidth/2)+3,1010-3),key,fill=(0,0,0), font=fntSmol)
|
||||||
|
textImage.text((32+(384*placement[x])+117-int(textWidth/2)-3,1010+3),key,fill=(0,0,0), font=fntSmol)
|
||||||
|
textImage.text((32+(384*placement[x])+117-int(textWidth/2)+3,1010+3),key,fill=(0,0,0), font=fntSmol)
|
||||||
|
textImage.text((32+(384*placement[x])+117-int(textWidth/2),1005),key,fill=(255,255,255), font=fntSmol)
|
||||||
|
|
||||||
table.save("resources/games/blackjackTables/blackjackTable"+channel+".png")
|
table.save("resources/games/blackjackTables/blackjackTable"+channel+".png")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user