pxt-calliope/docs/reference/images/create-big-image.md

53 lines
1.5 KiB
Markdown
Raw Normal View History

2016-06-18 00:00:24 +02:00
# 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.
2016-07-19 00:18:40 +02:00
```sig
2016-06-18 00:00:24 +02:00
images.createBigImage(`
. . # . . . . # . .
. # # # . . . # . .
# . # . # # . # . #
. . # . . . # # # .
. . # . . . . # . .
`);
```
2016-07-19 00:18:40 +02:00
### Parameters
* ``leds`` is a [string](/reference/types/string) that says which LEDs
on the screen should be on and which should be off.
2016-06-18 00:00:24 +02:00
### 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
2016-06-19 14:28:46 +02:00
[Getting Started](/getting-started), [image](/reference/images/image),
2016-06-18 00:00:24 +02:00
[create image](/reference/images/create-image),
[show image](/reference/images/show-image),
[scroll image](/reference/images/scroll-image), [show animation](/reference/basic/show-animation)