yes.
This commit is contained in:
parent
75d393fdf6
commit
523f413af2
1 changed files with 18 additions and 3 deletions
19
main.py
19
main.py
|
@ -84,9 +84,22 @@ def drawCanvas():
|
|||
canvas = Image.new('RGB', (192, 128), color = 'black')
|
||||
canvas.paste(get_track(),(0,96))
|
||||
songinfo = ImageDraw.Draw(canvas)
|
||||
songinfo.text((33,111), song_name)
|
||||
songinfo.text((33,101), artist_name)
|
||||
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)
|
||||
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)
|
||||
|
||||
|
||||
|
||||
|
@ -100,3 +113,5 @@ if __name__ == "__main__":
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue