The clear function for images.
Turn off all the pixels in an Image.
export function clear(img: micro_bit.Image)
The following example turns off the pixels of img
when the A input button is pressed:
let img = images.createImage(`
. . . . .
. # # # .
. # # # .
. # # # .
. . . . .
`)
img.showImage(0)
input.onButtonPressed(Button.A, () => {
img.clear()
img.showImage(0)
})
Image, show animation, show image, scroll image, create image