Scroll Image

Scroll (slide) an image (picture) from one side to the other of the LED screen.

let item: Image = null;
item.scrollImage(5, 200);

Parameters

Example

This program scrolls an image of two arrows five LEDs at a time, with a pause of 200 milliseconds between each time it scrolls. Because each frame is five LEDs wide, that means this program will look like it’s animating one arrow flipping and flopping. Of course, you can use any two frames you want instead.

let arrows = images.createBigImage(`
    . . # . .   . . # . .
    . # # # .   . . # . .
    # . # . #   # . # . #
    . . # . .   . # # # .
    . . # . .   . . # . .
    `);
basic.forever(() => {
    arrows.scrollImage(5, 200);
});

See also

show image, image, create image, show animation

Edit this page on GitHub