5. EXT: Scroll text
5.1. display.scroll full syntax
The use of the wait parameter is useful when wanting to scroll text and play sounds at the same time.
- display.scroll(value, delay=150, \*, wait=True, loop=False, monospace=False)
- Scrolls
value
horizontally on the display.value
can be an integer or float (a decimal) or a string.Thedelay
parameter controls how fast the text scrolls.The default delay is 150ms. When no delay is specified the default of 150ms is used.The use of
\*,
in the syntax is to indicate that for those parameters after it,wait
,loop
andmonospace
, the arguments must be specified using their keyword. e.gwait=True
is needed; not simplyTrue
.If
wait
isTrue
, this function will block until the animation is finished. Ifwait
isFalse
, the animation will happen in the background.If
loop
isTrue
, the animation will repeat forever.If
monospace
isTrue
, the characters will all take up 5 pixel-columns in width, otherwise there will be exactly 1 blank pixel-column between each character as they scroll.
Exercise
Experiment with the named parameters by trying them out with True or False to see what effect they have.
Experiment with scrolling text using
wait=False
and playing sounds.