Add more snippet types for better detection
This commit is contained in:
@ -6,7 +6,7 @@ Get the state of a pixel in an [Image](/reference/images/image).
|
||||
|
||||
### JavaScript
|
||||
|
||||
```
|
||||
```sig
|
||||
export function pixel(_this: micro_bit.Image, x: number, y: number) : boolean
|
||||
```
|
||||
|
||||
@ -29,7 +29,7 @@ This example gets the state of pixel `0, 0` in the `img` variable:
|
||||
|
||||
### ~hide
|
||||
|
||||
```
|
||||
```blocks
|
||||
let img = images.createImage(`
|
||||
. . # . . . . . . .
|
||||
. # . # . . . # . .
|
||||
@ -41,7 +41,7 @@ let img = images.createImage(`
|
||||
|
||||
### ~
|
||||
|
||||
```
|
||||
```blocks
|
||||
let state = img.pixel(0, 0)
|
||||
```
|
||||
|
||||
|
@ -6,7 +6,7 @@ Display an [Image](/reference/images/image) on the BBC micro:bit's [LED screen](
|
||||
|
||||
### JavaScript
|
||||
|
||||
```
|
||||
```sig
|
||||
export function showFrame(img: micro_bit.Image, frame: number)
|
||||
```
|
||||
|
||||
@ -20,7 +20,7 @@ The `show frame` function is the same as [plot frame](/reference/images/plot-fra
|
||||
|
||||
### Example
|
||||
|
||||
```
|
||||
```blocks
|
||||
let img = images.createImage(`
|
||||
# . . . # # . . . #
|
||||
. # . # . . # # # .
|
||||
|
@ -20,7 +20,7 @@ The following example gets the width of `img` and stores it in the `w` variable:
|
||||
|
||||
### ~hide
|
||||
|
||||
```
|
||||
```blocks
|
||||
let img = images.createImage(`
|
||||
. . # . . . . . . .
|
||||
. # . # . . . # . .
|
||||
@ -32,7 +32,7 @@ let img = images.createImage(`
|
||||
|
||||
### ~
|
||||
|
||||
```
|
||||
```blocks
|
||||
let w = img.width()
|
||||
```
|
||||
|
||||
@ -40,7 +40,7 @@ let w = img.width()
|
||||
|
||||
The following example uses the `width` function with a [for](/blocks/loops/for) loop to show each image frame on the screen:
|
||||
|
||||
```
|
||||
```blocks
|
||||
let img2 = images.createImage(`
|
||||
. . # . . . # # # # . # # # .
|
||||
. # # . . . . . . # . . . # .
|
||||
|
Reference in New Issue
Block a user