New page for 'create big image'

This commit is contained in:
Ron Hale-Evans 2016-06-17 15:00:24 -07:00
parent 74b6d99ab1
commit 7cb85ff459
2 changed files with 51 additions and 2 deletions

View File

@ -0,0 +1,46 @@
# Create Big Image
Make a big [image](/reference/images/image) (picture) for the micro:bit
[LED screen](/device/screen). The big image made of two squares.
Each of the squares is five LEDs on a side, like a regular image.
```blocks
images.createBigImage(`
. . # . . . . # . .
. # # # . . . # . .
# . # . # # . # . #
. . # . . . # # # .
. . # . . . . # . .
`);
```
### Example: Flip-flopping arrow
This program makes a big image with a picture of an arrow pointing up,
and an arrow pointing down. If you press button `A`, the program will
show the arrow pointing up, which starts `0` LEDs from the left in the
big image. If you press button `B`, the program will show the arrow
pointing down, which starts `5` LEDs from the left.
```blocks
let arrows = images.createBigImage(`
. . # . . . . # . .
. # # # . . . # . .
# . # . # # . # . #
. . # . . . # # # .
. . # . . . . # . .
`);
input.onButtonPressed(Button.A, () => {
arrows.showImage(0);
});
input.onButtonPressed(Button.B, () => {
arrows.showImage(5);
});
```
### See also
[Getting Started](/reference/getting-started), [image](/reference/images/image),
[create image](/reference/images/create-image),
[show image](/reference/image/show-image),
[scroll image](/reference/image/scroll-image), [show animation](/reference/basic/show-animation)

View File

@ -17,7 +17,7 @@ images.createImage(`
If you press button `A`, this program will make a picture of an If you press button `A`, this program will make a picture of an
arrow and show it on the LED screen. If you press button `B`, the arrow and show it on the LED screen. If you press button `B`, the
program will show a picture of the button upside-down. program will show a picture of the arrow upside-down.
```blocks ```blocks
input.onButtonPressed(Button.A, () => { input.onButtonPressed(Button.A, () => {
@ -42,5 +42,8 @@ input.onButtonPressed(Button.B, () => {
### See also ### See also
[Getting Started](/reference/getting-started), [image](/reference/images/image), [show image](/reference/image/show-image), [Getting Started](/reference/getting-started), [image](/reference/images/image),
[create big image](/reference/images/create-big-image),
[show image](/reference/image/show-image),
[scroll image](/reference/image/scroll-image), [show animation](/reference/basic/show-animation) [scroll image](/reference/image/scroll-image), [show animation](/reference/basic/show-animation)