pxt-calliope/docs/reference/images/plot-frame.md
Sam El-Husseini e3975e65e5 pxt-microbit Accessibility PR ()
* Accessibility changes
2017-09-07 13:42:08 -07:00

991 B

Plot Frame

The plot frame function.

Display an Image on the @boardname@'s LED screen

JavaScript

export function plotFrame(_this: micro_bit.Image, index: number)

Parameters

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

Difference from plot image

The plot frame function takes the index of the frame (if there are two frames, then the possible indices are 0 and 1), whereas plot image accepts an offset (if there are two frames, the offset would range between 0 and 9).

Example

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

See also

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