This commit is contained in:
Lukas Schulz 2020-12-20 01:44:06 +01:00
parent c4e3684117
commit 9f07752e78

View file

@ -102,19 +102,19 @@ def drawCanvas():
#scrolling_text(song_name,songinfo_offset_x, songinfo_offset_y+10) #scrolling_text(song_name,songinfo_offset_x, songinfo_offset_y+10)
global currently_scrolling_title global currently_scrolling_title
if(font.getsize(song_name)[0]>160 and not currently_scrolling_title): if(font.getsize(song_name)[0]>160 and not currently_scrolling_title):
x = threading.Thread(target=scrolling_text,args=(song_name,songinfo_offset_x,songinfo_offset_y+10,currently_scrolling_title)) x = threading.Thread(target=scrolling_text,args=(song_name,currently_scrolling_title,songinfo_offset_x,songinfo_offset_y+10))
x.start() x.start()
print('scrolling text started') print('scrolling text started')
global currently_scrolling_artist global currently_scrolling_artist
if(font.getsize(artist_name)[0]>160 and not currently_scrolling_artist): if(font.getsize(artist_name)[0]>160 and not currently_scrolling_artist):
y = threading.Thread(target=scrolling_text,args=(artist_name,songinfo_offset_x,songinfo_offset_y,currently_scrolling_artist)) y = threading.Thread(target=scrolling_text,args=(artist_name,currently_scrolling_artist,songinfo_offset_x,songinfo_offset_y))
y.start() y.start()
showImage(canvas) showImage(canvas)
def scrolling_text(text,offset_x=0,offset_y=0,scrolling_Boolean): def scrolling_text(text,scrolling_Boolean,offset_x=0,offset_y=0):
scrolling_Boolean = True scrolling_Boolean = True
for i in range(font.getsize(text)[0]-160): for i in range(font.getsize(text)[0]-160):
scrolled_text_canvas = Image.new('RGB', (160, 11), color = 'black') scrolled_text_canvas = Image.new('RGB', (160, 11), color = 'black')