Skip to content

Commit ab8a4dd

Browse files
committed
Suggest scrolling text left to right
1 parent c9d76f0 commit ab8a4dd

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

CircuitPython_RGBMatrix/simple_scroller.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,18 @@ def scroll(line):
6767
if line.x < -line_width:
6868
line.x = display.width
6969

70+
# This function scrolls lines backwards. Try switching which function is
71+
# called for line2 below!
72+
def reverse_scroll(line):
73+
line.x = line.x + 1
74+
line_width = line.bounding_box[2]
75+
if line.x >= display.width:
76+
line.x = -line_width
77+
7078
# You can add more effects in this loop. For instance, maybe you want to set the
71-
# color of each label to a different value
79+
# color of each label to a different value.
7280
while True:
7381
scroll(line1)
7482
scroll(line2)
83+
#reverse_scroll(line2)
7584
display.refresh(minimum_frames_per_second=0)

0 commit comments

Comments
 (0)