Skip to content

rhubarbdog/microbit-scrolling-images

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Scroll - scrolling text and images at any orientation.

Is your microbit always at the wrong angle when using microbit.display methods? scroll.py could be the answer scroll combined images and text upside down, upwards or scroll down.

There are 2 functions and 2 useful helper functions,

scroll(message,delay=150,upside_down=False,monospace=False)
scrolls text and images horizontally, message can be a string, or a list/tuple of strings and images.
delay controlls how fast the image scrolls.
if upside_down is True then the text will be scrolled upside down.
if monospace is True all text and images will be 5 pixels wide seperated by a single blank line. Otherwise images and characters have exactly one pixel of space between them. Except for single quotes because two single quotes look exactly like one double quotes.

scroll_up(message,delay=150,scroll_down=False,monospace=False)
scrolls text and images vertically, by default messages scroll up. message can be a string, or a list/tuple of strings and images.
delay controlls how fast the image scrolls.
if scroll_down is True then the text will be scrolled down.
if monospace is True all text and images will be 5 pixels wide seperated by a single blank line. Otherwise images and characters have exactly one pixel of space between them. Except for single quotes because two single quotes look exactly like one double quotes.

both scroll functions wait until the animation is complete. Should the display be deactivated (microbit.display.is_on() is False) then nothing will be displayed, and the functions return immediately.

There are 2 helper functions to manipulate images.
rotate_image(image,clockwise=True) returns a new image rotated by 90 degrees. If clockwise is False then the image will be rotated anticlockwise.
reflect_image(image,in_x=True) returns a new image reflected in either the x axis or when argument in_x is False then in the y axis.

About

Scroll text and images at any orientation on the microbit

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages