update input blocks in docs and tests
This commit is contained in:
@ -29,10 +29,10 @@ Display a left arrow when button A is pressed or a right arrow when button B is
|
||||
let arrowLeft = images.arrowImage(ArrowNames.West)
|
||||
let arrowRight = images.arrowImage(ArrowNames.East)
|
||||
|
||||
input.onButtonPressed(Button.A, () => {
|
||||
input.input.onButtonEvent(Button.A, DAL.MICROBIT_BUTTON_EVT_CLICK, () => {
|
||||
arrowLeft.showImage(0);
|
||||
});
|
||||
input.onButtonPressed(Button.B, () => {
|
||||
input.input.onButtonEvent(Button.B, DAL.MICROBIT_BUTTON_EVT_CLICK, () => {
|
||||
arrowRight.showImage(0);
|
||||
});
|
||||
```
|
||||
|
@ -36,10 +36,10 @@ let arrows = images.createBigImage(`
|
||||
. . # . . . # # # .
|
||||
. . # . . . . # . .
|
||||
`);
|
||||
input.onButtonPressed(Button.A, () => {
|
||||
input.input.onButtonEvent(Button.A, DAL.MICROBIT_BUTTON_EVT_CLICK, () => {
|
||||
arrows.showImage(0);
|
||||
});
|
||||
input.onButtonPressed(Button.B, () => {
|
||||
input.input.onButtonEvent(Button.B, DAL.MICROBIT_BUTTON_EVT_CLICK, () => {
|
||||
arrows.showImage(5);
|
||||
});
|
||||
```
|
||||
|
@ -25,7 +25,7 @@ arrow and show it on the LED screen. If you press button `B`, the
|
||||
program will show a picture of the arrow upside-down.
|
||||
|
||||
```blocks
|
||||
input.onButtonPressed(Button.A, () => {
|
||||
input.input.onButtonEvent(Button.A, DAL.MICROBIT_BUTTON_EVT_CLICK, () => {
|
||||
images.createImage(`
|
||||
. . # . .
|
||||
. # # # .
|
||||
@ -34,7 +34,7 @@ input.onButtonPressed(Button.A, () => {
|
||||
. . # . .
|
||||
`).showImage(0);
|
||||
});
|
||||
input.onButtonPressed(Button.B, () => {
|
||||
input.input.onButtonEvent(Button.B, DAL.MICROBIT_BUTTON_EVT_CLICK, () => {
|
||||
images.createImage(`
|
||||
. . # . .
|
||||
. . # . .
|
||||
|
@ -20,10 +20,10 @@ Show a happy face when button A is pressed or a sad face when button B is presse
|
||||
let iamHappy = images.iconImage(IconNames.Happy)
|
||||
let iamSad = images.iconImage(IconNames.Sad)
|
||||
|
||||
input.onButtonPressed(Button.A, () => {
|
||||
input.input.onButtonEvent(Button.A, DAL.MICROBIT_BUTTON_EVT_CLICK, () => {
|
||||
iamHappy.showImage(0);
|
||||
});
|
||||
input.onButtonPressed(Button.B, () => {
|
||||
input.input.onButtonEvent(Button.B, DAL.MICROBIT_BUTTON_EVT_CLICK, () => {
|
||||
iamSad.showImage(0);
|
||||
});
|
||||
```
|
||||
|
@ -31,10 +31,10 @@ let arrows = images.createBigImage(`
|
||||
. . # . . . # # # .
|
||||
. . # . . . . # . .
|
||||
`);
|
||||
input.onButtonPressed(Button.A, () => {
|
||||
input.input.onButtonEvent(Button.A, DAL.MICROBIT_BUTTON_EVT_CLICK, () => {
|
||||
arrows.showImage(0);
|
||||
});
|
||||
input.onButtonPressed(Button.B, () => {
|
||||
input.input.onButtonEvent(Button.B, DAL.MICROBIT_BUTTON_EVT_CLICK, () => {
|
||||
arrows.showImage(5);
|
||||
});
|
||||
```
|
||||
|
Reference in New Issue
Block a user