Open this page at https://emojigit.github.io/scroll-screen-api/
This repository can be added as an extension in MakeCode.
- open https://makecode.microbit.org/
- click on New Project
- click on Extensions under the gearwheel menu
- search for https://github.com/emojigit/scroll-screen-api and import
To edit this repository in MakeCode.
- open https://makecode.microbit.org/
- click on Import then click on Import URL
- paste https://github.com/emojigit/scroll-screen-api and click import
The class scroll.Scroller
is the basic class of this extension. When calling it, provide an array with arrays contains pre and post functions incide. See the following example:
let subScroll = new scroll.Scroller([
[
(function () {
basic.showLeds(`
. . # . .
. . # . .
# # # # #
. . # . .
. . # . .
`)
}),
(function () {
basic.showString("+++");
})
],
[
(function () {
basic.showLeds(`
. . . . .
. . . . .
# # # # #
. . . . .
. . . . .
`)
}),
(function () {
basic.showString("---");
})
],
])
let numberScroll = new scroll.NumberScroller(1)
new scroll.Scroller([
[
(function () {
basic.showLeds(`
. . # . .
. . # . .
# # # # #
. . # . .
. . # . .
`)
}),
(function () {
basic.showNumber(numberScroll.start());
})
],
[
(function () {
basic.showLeds(`
. . . . .
. . . . .
# # # # #
. . . . .
. . . . .
`)
}),
(function () {
basic.showString(scroll.booleanScroll().toString());
})
],
[
(function () {
basic.showLeds(`
# . . . #
. . . . .
. . # . .
. . . . .
# . . . #
`)
}),
(function () {
subScroll.start(true);
})
],
]).start()