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
valuehorizontally on the display.valuecan be an integer or float (a decimal) or a string.Thedelayparameter 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,loopandmonospace, the arguments must be specified using their keyword. e.gwait=Trueis needed; not simplyTrue.If
waitisTrue, this function will block until the animation is finished. IfwaitisFalse, the animation will happen in the background.If
loopisTrue, the animation will repeat forever.If
monospaceisTrue, 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=Falseand playing sounds.