pxt-calliope/docs/reference/images/show-frame.md
2016-03-25 16:47:20 -07:00

1.2 KiB

Show Frame

The show frame function. #showframe #docs #image #screen #LED

Display an Image on the BBC micro:bit's LED screen

KindScript

export function showFrame(img: micro_bit.Image, frame: number)

Parameters

  • index - Number; which frame of the image to display

Difference from plot frame

The show frame function is the same as plot frame, but contains a built-in delay after the LED screen has been updated (whereas plot frame has no built-in delay)

Example

let img = images.createImage(`
# . . . # # . . . #
. # . # . . # # # .
. . # . . . # # # .
. # . # . . # # # .
# . . . # # . . . #
`)
img.showFrame(1)

Lessons

smiley, flashing heart, magic logo

See also

create image, show animation, image, show image, scroll image