This commit is contained in:
Lukas Schulz 2020-12-20 01:13:57 +01:00
parent 91bbabc938
commit c3eb954243

View file

@ -83,13 +83,14 @@ def showImage(image, offset_x = 0, offset_y = 0):
def drawCanvas():
canvas = Image.new('RGB', (192, 128), color = 'black')
if(sp.currently_playing()['is_playing']):
canvas.paste(get_track(),(0,96))
songinfo = ImageDraw.Draw(canvas)
songinfo_offset_x = 33
songinfo_offset_y = 101
songinfo.text((songinfo_offset_x,songinfo_offset_y+10), song_name)
songinfo.text((songinfo_offset_x,songinfo_offset_y), artist_name)
showImage(canvas)
#scrolling_text(song_name,songinfo_offset_x, songinfo_offset_y+10)
if(font.getsize(song_name)[0]>160):
x = threading.Thread(target=scrolling_text,args=(song_name,songinfo_offset_x,songinfo_offset_y+10))
@ -98,7 +99,7 @@ def drawCanvas():
if(font.getsize(artist_name)[0]>160):
y = threading.Thread(target=scrolling_text,args=(artist_name,songinfo_offset_x,songinfo_offset_y))
y.start()
showImage(canvas)
def scrolling_text(text,offset_x=0,offset_y=0):