yes.
This commit is contained in:
parent
c3f54a5739
commit
a63fe85c3f
1 changed files with 3 additions and 3 deletions
6
main.py
6
main.py
|
@ -121,12 +121,12 @@ def scrolling_text(text,offset_x=0,offset_y=0):
|
||||||
#print(scroll_frame_time)
|
#print(scroll_frame_time)
|
||||||
if(scroll_frame_time>0.1):
|
if(scroll_frame_time>0.1):
|
||||||
scroll_frame_time = 0.1
|
scroll_frame_time = 0.1
|
||||||
for i in range((font.getsize(text)[0]-160)*5):
|
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')
|
||||||
scrolled_text = ImageDraw.Draw(scrolled_text_canvas)
|
scrolled_text = ImageDraw.Draw(scrolled_text_canvas)
|
||||||
scrolled_text.text((-i/5,0), text)
|
scrolled_text.text((-i,0), text)
|
||||||
showImage(scrolled_text_canvas, offset_x, offset_y)
|
showImage(scrolled_text_canvas, offset_x, offset_y)
|
||||||
time.sleep(scroll_frame_time/5)
|
time.sleep(scroll_frame_time)
|
||||||
#print('scrolled '+str(i)+' px')
|
#print('scrolled '+str(i)+' px')
|
||||||
if((5-(font.getsize(text)[0]-160)*2*scroll_frame_time)>0):
|
if((5-(font.getsize(text)[0]-160)*2*scroll_frame_time)>0):
|
||||||
time.sleep(5-(font.getsize(text)[0]-160)*2*scroll_frame_time)
|
time.sleep(5-(font.getsize(text)[0]-160)*2*scroll_frame_time)
|
||||||
|
|
Loading…
Reference in a new issue