More snippet types
This commit is contained in:
@ -6,7 +6,7 @@ Display an [Image](/reference/images/image) on the BBC micro:bit's [LED screen](
|
||||
|
||||
### JavaScript
|
||||
|
||||
```
|
||||
```sig
|
||||
export function plotFrame(_this: micro_bit.Image, index: number)
|
||||
```
|
||||
|
||||
@ -20,7 +20,7 @@ The `plot frame` function takes the index of the frame (if there are two frames,
|
||||
|
||||
### Example
|
||||
|
||||
```
|
||||
```blocks
|
||||
let img = images.createImage(`
|
||||
# . . . # # . . . #
|
||||
. # . # . . # # # .
|
||||
|
@ -6,7 +6,7 @@ Display an [Image](/reference/images/image) on the BBC micro:bit's [LED screen](
|
||||
|
||||
### JavaScript
|
||||
|
||||
```
|
||||
```sig
|
||||
export function plotImage(_this: micro_bit.Image, xOffset: number)
|
||||
```
|
||||
|
||||
@ -20,7 +20,7 @@ The `show image` function has a built in delay of 400ms after display of the ima
|
||||
|
||||
### Example
|
||||
|
||||
```
|
||||
```blocks
|
||||
let img = images.createImage(`
|
||||
# . . . # # . . . #
|
||||
. # . # . . # # # .
|
||||
|
@ -6,7 +6,7 @@ Set the on/off state of pixel in an [Image](/reference/images/image).
|
||||
|
||||
### JavaScript
|
||||
|
||||
```
|
||||
```sig
|
||||
export function setPixel(_this: micro_bit.Image, x: number, y: number, value: boolean)
|
||||
```
|
||||
|
||||
@ -24,7 +24,7 @@ To figure out the ``x``, ``y`` coordinates, see [LED screen](/device/screen).
|
||||
|
||||
The following example creates an image and stores it in the `img` variable. The `set pixel` function sets the centre pixel off, before `img` is shown using `show image`.
|
||||
|
||||
```
|
||||
```blocks
|
||||
let img = images.createImage(`
|
||||
. . # . .
|
||||
. # . # .
|
||||
|
Reference in New Issue
Block a user