yes.
This commit is contained in:
parent
75d393fdf6
commit
523f413af2
1 changed files with 18 additions and 3 deletions
21
main.py
21
main.py
|
@ -84,12 +84,25 @@ def drawCanvas():
|
||||||
canvas = Image.new('RGB', (192, 128), color = 'black')
|
canvas = Image.new('RGB', (192, 128), color = 'black')
|
||||||
canvas.paste(get_track(),(0,96))
|
canvas.paste(get_track(),(0,96))
|
||||||
songinfo = ImageDraw.Draw(canvas)
|
songinfo = ImageDraw.Draw(canvas)
|
||||||
songinfo.text((33,111), song_name)
|
songinfo_offset_x = 33
|
||||||
songinfo.text((33,101), artist_name)
|
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)
|
showImage(canvas)
|
||||||
|
if(ImageDraw.textlength(song_name)>160):
|
||||||
|
x = threading.Thread(target=scrolling_text,args=(song_name,songinfo_offset_x,songinfo_offset_y+10))
|
||||||
|
if(ImageDraw.textlength(artist_name)>160):
|
||||||
|
y = threading.Thread(target=scrolling_text,args=(artist_name,songinfo_offset_x,songinfo_offset_y))
|
||||||
|
|
||||||
|
def scrolling_text(text,offset_x=0,offset_y=0):
|
||||||
|
for i in range(160-ImageDraw.textlength(text)):
|
||||||
|
scrolled_text_canvas = Image.new('RGB', (10, 32), color = 'black')
|
||||||
|
scrolled_text = ImageDraw.Draw(scrolled_text)
|
||||||
|
scrolled_text.text((-i,0), text)
|
||||||
|
showImage(canvas, offset_x, offset_y)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
#main()
|
#main()
|
||||||
print('text')
|
print('text')
|
||||||
|
@ -99,4 +112,6 @@ if __name__ == "__main__":
|
||||||
time.sleep(10)
|
time.sleep(10)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue