yes.
This commit is contained in:
parent
91bbabc938
commit
c3eb954243
1 changed files with 16 additions and 15 deletions
5
main.py
5
main.py
|
@ -83,13 +83,14 @@ def showImage(image, offset_x = 0, offset_y = 0):
|
||||||
|
|
||||||
def drawCanvas():
|
def drawCanvas():
|
||||||
canvas = Image.new('RGB', (192, 128), color = 'black')
|
canvas = Image.new('RGB', (192, 128), color = 'black')
|
||||||
|
if(sp.currently_playing()['is_playing']):
|
||||||
canvas.paste(get_track(),(0,96))
|
canvas.paste(get_track(),(0,96))
|
||||||
songinfo = ImageDraw.Draw(canvas)
|
songinfo = ImageDraw.Draw(canvas)
|
||||||
songinfo_offset_x = 33
|
songinfo_offset_x = 33
|
||||||
songinfo_offset_y = 101
|
songinfo_offset_y = 101
|
||||||
songinfo.text((songinfo_offset_x,songinfo_offset_y+10), song_name)
|
songinfo.text((songinfo_offset_x,songinfo_offset_y+10), song_name)
|
||||||
songinfo.text((songinfo_offset_x,songinfo_offset_y), artist_name)
|
songinfo.text((songinfo_offset_x,songinfo_offset_y), artist_name)
|
||||||
showImage(canvas)
|
|
||||||
#scrolling_text(song_name,songinfo_offset_x, songinfo_offset_y+10)
|
#scrolling_text(song_name,songinfo_offset_x, songinfo_offset_y+10)
|
||||||
if(font.getsize(song_name)[0]>160):
|
if(font.getsize(song_name)[0]>160):
|
||||||
x = threading.Thread(target=scrolling_text,args=(song_name,songinfo_offset_x,songinfo_offset_y+10))
|
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):
|
if(font.getsize(artist_name)[0]>160):
|
||||||
y = threading.Thread(target=scrolling_text,args=(artist_name,songinfo_offset_x,songinfo_offset_y))
|
y = threading.Thread(target=scrolling_text,args=(artist_name,songinfo_offset_x,songinfo_offset_y))
|
||||||
y.start()
|
y.start()
|
||||||
|
showImage(canvas)
|
||||||
|
|
||||||
|
|
||||||
def scrolling_text(text,offset_x=0,offset_y=0):
|
def scrolling_text(text,offset_x=0,offset_y=0):
|
||||||
|
|
Loading…
Reference in a new issue