yes.
This commit is contained in:
parent
d7dcf11938
commit
2bc33ae18c
1 changed files with 14 additions and 15 deletions
29
main.py
29
main.py
|
@ -102,21 +102,20 @@ def drawCanvas():
|
|||
|
||||
|
||||
def scrolling_text(text,offset_x=0,offset_y=0):
|
||||
while True:
|
||||
for i in range(font.getsize(text)[0]-160):
|
||||
scrolled_text_canvas = Image.new('RGB', (160, 32), color = 'black')
|
||||
scrolled_text = ImageDraw.Draw(scrolled_text_canvas)
|
||||
scrolled_text.text((-i,0), text)
|
||||
showImage(scrolled_text_canvas, offset_x, offset_y)
|
||||
time.sleep(0.1)
|
||||
print('scrolled '+str(i)+' px')
|
||||
for i in range(font.getsize(text)[0]-160):
|
||||
scrolled_text_canvas = Image.new('RGB', (160, 32), color = 'black')
|
||||
scrolled_text = ImageDraw.Draw(scrolled_text_canvas)
|
||||
scrolled_text.text((font.getsize(text)[0]-160-i,0), text)
|
||||
showImage(scrolled_text_canvas, offset_x, offset_y)
|
||||
time.sleep(0.1)
|
||||
print('scrolled '+str(i)+' px')
|
||||
for i in range(font.getsize(text)[0]-160):
|
||||
scrolled_text_canvas = Image.new('RGB', (160, 32), color = 'black')
|
||||
scrolled_text = ImageDraw.Draw(scrolled_text_canvas)
|
||||
scrolled_text.text((-i,0), text)
|
||||
showImage(scrolled_text_canvas, offset_x, offset_y)
|
||||
time.sleep(0.1)
|
||||
print('scrolled '+str(i)+' px')
|
||||
for i in range(font.getsize(text)[0]-160):
|
||||
scrolled_text_canvas = Image.new('RGB', (160, 32), color = 'black')
|
||||
scrolled_text = ImageDraw.Draw(scrolled_text_canvas)
|
||||
scrolled_text.text((font.getsize(text)[0]-160+i,0), text)
|
||||
showImage(scrolled_text_canvas, offset_x, offset_y)
|
||||
time.sleep(0.1)
|
||||
print('scrolled '+str(i)+' px')
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue