2017-02-28 18:50:29 +01:00
|
|
|
/*
|
|
|
|
The MIT License (MIT)
|
|
|
|
|
|
|
|
Copyright (c) 2013-2016 The MicroPython-on-micro:bit Developers, as listed
|
|
|
|
in the accompanying AUTHORS file
|
|
|
|
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
of this software and associated documentation files (the "Software"), to deal
|
|
|
|
in the Software without restriction, including without limitation the rights
|
|
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
copies of the Software, and to permit persons to whom the Software is
|
|
|
|
furnished to do so, subject to the following conditions:
|
|
|
|
|
|
|
|
The above copyright notice and this permission notice shall be included in
|
|
|
|
all copies or substantial portions of the Software.
|
|
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
THE SOFTWARE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
// Images from file microbitconstimage.cpp https://github.com/bbcmicrobit/micropython
|
|
|
|
|
|
|
|
enum IconNames {
|
|
|
|
//% block="heart"
|
2019-12-02 05:58:26 +01:00
|
|
|
//% jres=icons.heart
|
2017-02-28 18:50:29 +01:00
|
|
|
Heart = 0,
|
|
|
|
//% block="small heart"
|
2019-12-02 05:58:26 +01:00
|
|
|
//% jres=icons.smallheart
|
2017-02-28 18:50:29 +01:00
|
|
|
SmallHeart,
|
|
|
|
//% block="yes"
|
2019-12-02 05:58:26 +01:00
|
|
|
//% jres=icons.yes
|
2017-02-28 18:50:29 +01:00
|
|
|
Yes,
|
|
|
|
//% block="no"
|
2019-12-02 05:58:26 +01:00
|
|
|
//% jres=icons.no
|
2017-02-28 18:50:29 +01:00
|
|
|
No,
|
|
|
|
//% block="happy"
|
2019-12-02 05:58:26 +01:00
|
|
|
//% jres=icons.happy
|
2017-02-28 18:50:29 +01:00
|
|
|
Happy,
|
|
|
|
//% block="sad"
|
2019-12-02 05:58:26 +01:00
|
|
|
//% jres=icons.sad
|
2017-02-28 18:50:29 +01:00
|
|
|
Sad,
|
|
|
|
//% block="confused"
|
2019-12-02 05:58:26 +01:00
|
|
|
//% jres=icons.confused
|
2017-02-28 18:50:29 +01:00
|
|
|
Confused,
|
|
|
|
//% block="angry"
|
2019-12-02 05:58:26 +01:00
|
|
|
//% jres=icons.angry
|
2017-02-28 18:50:29 +01:00
|
|
|
Angry,
|
|
|
|
//% block="asleep"
|
2019-12-02 05:58:26 +01:00
|
|
|
//% jres=icons.asleep
|
2017-02-28 18:50:29 +01:00
|
|
|
Asleep,
|
|
|
|
//% block="surprised"
|
2019-12-02 05:58:26 +01:00
|
|
|
//% jres=icons.surprised
|
2017-02-28 18:50:29 +01:00
|
|
|
Surprised,
|
|
|
|
//% block="silly"
|
2019-12-02 05:58:26 +01:00
|
|
|
//% jres=icons.silly
|
2017-02-28 18:50:29 +01:00
|
|
|
Silly,
|
|
|
|
//% block="fabulous"
|
2019-12-02 05:58:26 +01:00
|
|
|
//% jres=icons.fabulous
|
2017-02-28 18:50:29 +01:00
|
|
|
Fabulous,
|
|
|
|
//% block="meh"
|
2019-12-02 05:58:26 +01:00
|
|
|
//% jres=icons.meh
|
2017-02-28 18:50:29 +01:00
|
|
|
Meh,
|
2022-04-04 18:53:29 +02:00
|
|
|
//% block="t-shirt"
|
|
|
|
//% jres=icons.tshirt
|
|
|
|
TShirt,
|
|
|
|
//% block="roller skate"
|
|
|
|
//% jres=icons.rollerskate
|
|
|
|
Rollerskate,
|
|
|
|
//% block="duck"
|
|
|
|
//% jres=icons.duck
|
|
|
|
Duck,
|
|
|
|
//% block="house"
|
|
|
|
//% jres=icons.house
|
|
|
|
House,
|
|
|
|
//% block="tortoise"
|
|
|
|
//% jres=icons.tortoise
|
|
|
|
Tortoise,
|
|
|
|
//% block="butterfly"
|
|
|
|
//% jres=icons.butterfly
|
|
|
|
Butterfly,
|
|
|
|
//% block="stick figure"
|
|
|
|
//% jres=icons.stickfigure
|
|
|
|
StickFigure,
|
|
|
|
//% block="ghost"
|
|
|
|
//% jres=icons.ghost
|
|
|
|
Ghost,
|
|
|
|
//% block="sword"
|
|
|
|
//% jres=icons.sword
|
|
|
|
Sword,
|
|
|
|
//% block="giraffe"
|
|
|
|
//% jres=icons.giraffe
|
|
|
|
Giraffe,
|
|
|
|
//% block="skull"
|
|
|
|
//% jres=icons.skull
|
|
|
|
Skull,
|
|
|
|
//% block="umbrella"
|
|
|
|
//% jres=icons.umbrella
|
|
|
|
Umbrella,
|
|
|
|
//% block="snake"
|
|
|
|
//% jres=icons.snake
|
|
|
|
Snake,
|
|
|
|
//% block="rabbit"
|
|
|
|
//% jres=icons.rabbit
|
|
|
|
Rabbit,
|
|
|
|
//% block="cow"
|
|
|
|
//% jres=icons.cow
|
|
|
|
Cow,
|
|
|
|
//% block="quarter note"
|
|
|
|
//% jres=icons.quarternote
|
|
|
|
QuarterNote,
|
|
|
|
//% block="eigth note"
|
|
|
|
//% jres=icons.eigthnote
|
|
|
|
EigthNote,
|
|
|
|
//% block="pitchfork"
|
|
|
|
//% jres=icons.pitchfork
|
|
|
|
Pitchfork,
|
|
|
|
//% block="target"
|
|
|
|
//% jres=icons.target
|
|
|
|
Target,
|
|
|
|
//% block="triangle"
|
|
|
|
//% jres=icons.triangle
|
|
|
|
Triangle,
|
|
|
|
//% block="left triangle"
|
|
|
|
//% jres=icons.lefttriangle
|
|
|
|
LeftTriangle,
|
|
|
|
//% block="chess board"
|
|
|
|
//% jres=icons.chessboard
|
|
|
|
Chessboard,
|
|
|
|
//% block="diamond"
|
|
|
|
//% jres=icons.diamond
|
|
|
|
Diamond,
|
|
|
|
//% block="small diamond"
|
|
|
|
//% jres=icons.smalldiamond
|
|
|
|
SmallDiamond,
|
|
|
|
//% block="square"
|
|
|
|
//% jres=icons.square
|
|
|
|
Square,
|
|
|
|
//% block="small square"
|
|
|
|
//% jres=icons.smallsquare
|
|
|
|
SmallSquare,
|
|
|
|
//% block="scissors"
|
|
|
|
//% jres=icons.scissors
|
|
|
|
Scissors,
|
2020-09-11 14:18:32 +02:00
|
|
|
//% block="arrow north"
|
|
|
|
//% jres=icons.arrownorth
|
|
|
|
ArrowNorth,
|
|
|
|
//% block="arrow north east"
|
|
|
|
//% jres=icons.arrownortheast
|
|
|
|
ArrowNorthEast,
|
|
|
|
//% block="arrow East"
|
|
|
|
//% jres=icons.arroweast
|
|
|
|
ArrowEast,
|
|
|
|
//% block="arrow south east"
|
|
|
|
//% jres=icons.arrowsoutheast
|
|
|
|
ArrowSouthEast,
|
|
|
|
//% block="arrow south"
|
|
|
|
//% jres=icons.arrowsouth
|
|
|
|
ArrowSouth,
|
|
|
|
//% block="arrow south west"
|
|
|
|
//% jres=icons.arrowsouthwest
|
|
|
|
ArrowSouthWest,
|
|
|
|
//% block="arrow west"
|
|
|
|
//% jres=icons.arrowwest
|
|
|
|
ArrowWest,
|
|
|
|
//% block="arrow north west"
|
|
|
|
//% jres=icons.arrownorthwest
|
|
|
|
ArrowNorthWest
|
2017-02-28 18:50:29 +01:00
|
|
|
}
|
|
|
|
|
2022-04-04 18:53:29 +02:00
|
|
|
enum ArrowNames {
|
|
|
|
//% blockIdentity=images.arrowNumber block="North"
|
|
|
|
North = 0,
|
|
|
|
//% blockIdentity=images.arrowNumber block="North East"
|
|
|
|
NorthEast,
|
|
|
|
//% blockIdentity=images.arrowNumber block="East"
|
|
|
|
East,
|
|
|
|
//% blockIdentity=images.arrowNumber block="South East"
|
|
|
|
SouthEast,
|
|
|
|
//% blockIdentity=images.arrowNumber block="South"
|
|
|
|
South,
|
|
|
|
//% blockIdentity=images.arrowNumber block="South West"
|
|
|
|
SouthWest,
|
|
|
|
//% blockIdentity=images.arrowNumber block="West"
|
|
|
|
West,
|
|
|
|
//% blockIdentity=images.arrowNumber block="North West"
|
|
|
|
NorthWest
|
|
|
|
}
|
2017-02-28 18:50:29 +01:00
|
|
|
|
|
|
|
namespace basic {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Draws the selected icon on the LED screen
|
2019-12-02 05:58:26 +01:00
|
|
|
* @param icon the predefined icon id
|
2022-03-22 17:36:19 +01:00
|
|
|
* @param interval the amount of time (milliseconds) to block the LED Matrix for showing the icon. Default is 200.
|
2017-02-28 18:50:29 +01:00
|
|
|
*/
|
|
|
|
//% weight=90 blockGap=8
|
2017-12-14 20:04:59 +01:00
|
|
|
//% blockId=basic_show_icon
|
2022-03-22 17:36:19 +01:00
|
|
|
//% block="show icon %i || for %interval ms" icon="\uf00a"
|
2017-02-28 18:50:29 +01:00
|
|
|
//% parts="ledmatrix"
|
|
|
|
//% help=basic/show-icon
|
2019-12-02 05:58:26 +01:00
|
|
|
//% icon.fieldEditor="imagedropdown"
|
|
|
|
//% icon.fieldOptions.columns="5"
|
|
|
|
//% icon.fieldOptions.width="380"
|
|
|
|
//% icon.fieldOptions.maxRows=4
|
2022-03-22 17:36:19 +01:00
|
|
|
//% expandableArgumentMode="toggle"
|
|
|
|
//% interval.defl=200
|
|
|
|
//% group="LED matrix"
|
|
|
|
export function showIcon(icon: IconNames, interval = 200) {
|
2017-02-28 18:50:29 +01:00
|
|
|
let res = images.iconImage(icon)
|
2017-12-14 20:04:59 +01:00
|
|
|
res.showImage(0, interval)
|
2017-02-28 18:50:29 +01:00
|
|
|
}
|
|
|
|
|
2022-04-04 18:53:29 +02:00
|
|
|
/**
|
|
|
|
* Draws an arrow on the LED screen
|
|
|
|
* @param direction the direction of the arrow
|
|
|
|
* @param interval the amount of time (milliseconds) to show the icon. Default is 600.
|
|
|
|
*/
|
|
|
|
//% weight=50 blockGap=8
|
|
|
|
//% blockId=basic_show_arrow
|
|
|
|
//% block="show arrow %i=device_arrow"
|
|
|
|
//% parts="ledmatrix"
|
|
|
|
//% advanced=true
|
|
|
|
//% help=basic/show-arrow
|
|
|
|
//% deprecated=true
|
|
|
|
export function showArrow(direction: number, interval = 600) {
|
|
|
|
let res = images.arrowImage(direction)
|
|
|
|
res.showImage(0, interval)
|
|
|
|
}
|
2017-02-28 18:50:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
namespace images {
|
|
|
|
|
2022-04-04 18:53:29 +02:00
|
|
|
//% weight=50 blockGap=8
|
|
|
|
//% help=images/arrow-image
|
|
|
|
//% blockId=builtin_arrow_image block="arrow image %i"
|
|
|
|
//% deprecated=true
|
|
|
|
export function arrowImage(i: ArrowNames): Image {
|
|
|
|
switch (i) {
|
|
|
|
// compass directions
|
|
|
|
case ArrowNames.North: return images.createImage(`
|
|
|
|
. . # . .
|
|
|
|
. # # # .
|
|
|
|
# . # . #
|
|
|
|
. . # . .
|
|
|
|
. . # . .`);
|
|
|
|
case ArrowNames.NorthEast: return images.createImage(`
|
|
|
|
. . # # #
|
|
|
|
. . . # #
|
|
|
|
. . # . #
|
|
|
|
. # . . .
|
|
|
|
# . . . .`);
|
|
|
|
case ArrowNames.East: return images.createImage(`
|
|
|
|
. . # . .
|
|
|
|
. . . # .
|
|
|
|
# # # # #
|
|
|
|
. . . # .
|
|
|
|
. . # . .`);
|
|
|
|
case ArrowNames.SouthEast: return images.createImage(`
|
|
|
|
# . . . .
|
|
|
|
. # . . .
|
|
|
|
. . # . #
|
|
|
|
. . . # #
|
|
|
|
. . # # #`);
|
|
|
|
case ArrowNames.South: return images.createImage(`
|
|
|
|
. . # . .
|
|
|
|
. . # . .
|
|
|
|
# . # . #
|
|
|
|
. # # # .
|
|
|
|
. . # . .`);
|
|
|
|
case ArrowNames.SouthWest: return images.createImage(`
|
|
|
|
. . . . #
|
|
|
|
. . . # .
|
|
|
|
# . # . .
|
|
|
|
# # . . .
|
|
|
|
# # # . .`);
|
|
|
|
case ArrowNames.West: return images.createImage(`
|
|
|
|
. . # . .
|
|
|
|
. # . . .
|
|
|
|
# # # # #
|
|
|
|
. # . . .
|
|
|
|
. . # . .`);
|
|
|
|
case ArrowNames.NorthWest: return images.createImage(`
|
|
|
|
# # # . .
|
|
|
|
# # . . .
|
|
|
|
# . # . .
|
|
|
|
. . . # .
|
|
|
|
. . . . #`);
|
|
|
|
default: return images.createImage(`
|
|
|
|
. . . . .
|
|
|
|
. . . . .
|
|
|
|
. . . . .
|
|
|
|
. . . . .
|
|
|
|
. . . . .
|
|
|
|
`);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-12-14 20:04:59 +01:00
|
|
|
//% weight=50 blockGap=8
|
|
|
|
//% help=images/icon-image
|
|
|
|
//% blockId=builtin_image block="icon image %i"
|
2019-12-02 05:58:26 +01:00
|
|
|
//% i.fieldEditor="imagedropdown"
|
|
|
|
//% i.fieldOptions.columns="5"
|
|
|
|
//% i.fieldOptions.width="380"
|
|
|
|
//% i.fieldOptions.maxRows=4
|
2017-12-14 20:04:59 +01:00
|
|
|
export function iconImage(i: IconNames): Image {
|
|
|
|
switch (i) {
|
|
|
|
case IconNames.Heart: return images.createImage(`
|
2017-02-28 18:50:29 +01:00
|
|
|
. # . # .
|
|
|
|
# # # # #
|
|
|
|
# # # # #
|
|
|
|
. # # # .
|
2017-12-14 20:04:59 +01:00
|
|
|
. . # . .`);
|
2017-02-28 18:50:29 +01:00
|
|
|
|
2017-12-14 20:04:59 +01:00
|
|
|
case IconNames.SmallHeart: return images.createImage(`
|
2017-02-28 18:50:29 +01:00
|
|
|
. . . . .
|
|
|
|
. # . # .
|
|
|
|
. # # # .
|
|
|
|
. . # . .
|
2017-12-14 20:04:59 +01:00
|
|
|
. . . . .`);
|
|
|
|
//faces
|
|
|
|
case IconNames.Happy: return images.createImage(`
|
2017-02-28 18:50:29 +01:00
|
|
|
. . . . .
|
|
|
|
. # . # .
|
|
|
|
. . . . .
|
|
|
|
# . . . #
|
2017-12-14 20:04:59 +01:00
|
|
|
. # # # .`);
|
|
|
|
case IconNames.Sad: return images.createImage(`
|
2017-02-28 18:50:29 +01:00
|
|
|
. . . . .
|
|
|
|
. # . # .
|
|
|
|
. . . . .
|
|
|
|
. # # # .
|
2017-12-14 20:04:59 +01:00
|
|
|
# . . . #`);
|
|
|
|
case IconNames.Confused: return images.createImage(`
|
2017-02-28 18:50:29 +01:00
|
|
|
. . . . .
|
|
|
|
. # . # .
|
|
|
|
. . . . .
|
|
|
|
. # . # .
|
2017-12-14 20:04:59 +01:00
|
|
|
# . # . #`);
|
|
|
|
case IconNames.Angry: return images.createImage(`
|
2017-02-28 18:50:29 +01:00
|
|
|
# . . . #
|
|
|
|
. # . # .
|
|
|
|
. . . . .
|
|
|
|
# # # # #
|
2017-12-14 20:04:59 +01:00
|
|
|
# . # . #`);
|
|
|
|
case IconNames.Asleep: return images.createImage(`
|
2017-02-28 18:50:29 +01:00
|
|
|
. . . . .
|
|
|
|
# # . # #
|
|
|
|
. . . . .
|
|
|
|
. # # # .
|
2017-12-14 20:04:59 +01:00
|
|
|
. . . . .`);
|
|
|
|
case IconNames.Surprised: return images.createImage(`
|
2017-02-28 18:50:29 +01:00
|
|
|
. # . # .
|
|
|
|
. . . . .
|
|
|
|
. . # . .
|
|
|
|
. # . # .
|
2017-12-14 20:04:59 +01:00
|
|
|
. . # . .`);
|
|
|
|
case IconNames.Silly: return images.createImage(`
|
2017-02-28 18:50:29 +01:00
|
|
|
# . . . #
|
|
|
|
. . . . .
|
|
|
|
# # # # #
|
|
|
|
. . . # #
|
2017-12-14 20:04:59 +01:00
|
|
|
. . . # #`);
|
|
|
|
case IconNames.Fabulous: return images.createImage(`
|
2017-02-28 18:50:29 +01:00
|
|
|
# # # # #
|
|
|
|
# # . # #
|
|
|
|
. . . . .
|
|
|
|
. # . # .
|
2017-12-14 20:04:59 +01:00
|
|
|
. # # # .`);
|
|
|
|
case IconNames.Meh: return images.createImage(`
|
2017-02-28 18:50:29 +01:00
|
|
|
# # . # #
|
|
|
|
. . . . .
|
|
|
|
. . . # .
|
|
|
|
. . # . .
|
2017-12-14 20:04:59 +01:00
|
|
|
. # . . .`);
|
|
|
|
case IconNames.Yes: return images.createImage(`
|
2017-02-28 18:50:29 +01:00
|
|
|
. . . . .
|
|
|
|
. . . . #
|
|
|
|
. . . # .
|
|
|
|
# . # . .
|
2017-12-14 20:04:59 +01:00
|
|
|
. # . . .`);
|
|
|
|
case IconNames.No: return images.createImage(`
|
2017-02-28 18:50:29 +01:00
|
|
|
# . . . #
|
|
|
|
. # . # .
|
|
|
|
. . # . .
|
|
|
|
. # . # .
|
2017-12-14 20:04:59 +01:00
|
|
|
# . . . #`);
|
2022-04-04 18:53:29 +02:00
|
|
|
case IconNames.Triangle: return images.createImage(`
|
|
|
|
. . . . .
|
|
|
|
. . # . .
|
|
|
|
. # . # .
|
|
|
|
# # # # #
|
|
|
|
. . . . .`);
|
|
|
|
case IconNames.LeftTriangle: return images.createImage(`
|
|
|
|
# . . . .
|
|
|
|
# # . . .
|
|
|
|
# . # . .
|
|
|
|
# . . # .
|
|
|
|
# # # # #`);
|
|
|
|
case IconNames.Chessboard: return images.createImage(`
|
|
|
|
. # . # .
|
|
|
|
# . # . #
|
|
|
|
. # . # .
|
|
|
|
# . # . #
|
|
|
|
. # . # .`);
|
|
|
|
case IconNames.Diamond: return images.createImage(`
|
|
|
|
. . # . .
|
|
|
|
. # . # .
|
|
|
|
# . . . #
|
|
|
|
. # . # .
|
|
|
|
. . # . .`);
|
|
|
|
case IconNames.SmallDiamond: return images.createImage(`
|
|
|
|
. . . . .
|
|
|
|
. . # . .
|
|
|
|
. # . # .
|
|
|
|
. . # . .
|
|
|
|
. . . . .`);
|
|
|
|
case IconNames.Square: return images.createImage(`
|
|
|
|
# # # # #
|
|
|
|
# . . . #
|
|
|
|
# . . . #
|
|
|
|
# . . . #
|
|
|
|
# # # # #`);
|
|
|
|
case IconNames.SmallSquare: return images.createImage(`
|
|
|
|
. . . . .
|
|
|
|
. # # # .
|
|
|
|
. # . # .
|
|
|
|
. # # # .
|
|
|
|
. . . . .`);
|
|
|
|
|
|
|
|
case IconNames.Scissors: return images.createImage(`
|
|
|
|
# # . . #
|
|
|
|
# # . # .
|
|
|
|
. . # . .
|
|
|
|
# # . # .
|
|
|
|
# # . . #`);
|
|
|
|
// The following images were designed by Abbie Brooks.
|
|
|
|
case IconNames.TShirt: return images.createImage(`
|
|
|
|
# # . # #
|
|
|
|
# # # # #
|
|
|
|
. # # # .
|
|
|
|
. # # # .
|
|
|
|
. # # # .`);
|
|
|
|
case IconNames.Rollerskate: return images.createImage(`
|
|
|
|
. . . # #
|
|
|
|
. . . # #
|
|
|
|
# # # # #
|
|
|
|
# # # # #
|
|
|
|
. # . # .`);
|
|
|
|
case IconNames.Duck: return images.createImage(`
|
|
|
|
. # # . .
|
|
|
|
# # # . .
|
|
|
|
. # # # #
|
|
|
|
. # # # .
|
|
|
|
. . . . .`);
|
|
|
|
case IconNames.House: return images.createImage(`
|
|
|
|
. . # . .
|
|
|
|
. # # # .
|
|
|
|
# # # # #
|
|
|
|
. # # # .
|
|
|
|
. # . # .`);
|
|
|
|
case IconNames.Tortoise: return images.createImage(`
|
|
|
|
. . . . .
|
|
|
|
. # # # .
|
|
|
|
# # # # #
|
|
|
|
. # . # .
|
|
|
|
. . . . .`);
|
|
|
|
case IconNames.Butterfly: return images.createImage(`
|
|
|
|
# # . # #
|
|
|
|
# # # # #
|
|
|
|
. . # . .
|
|
|
|
# # # # #
|
|
|
|
# # . # #`);
|
|
|
|
case IconNames.StickFigure: return images.createImage(`
|
|
|
|
. . # . .
|
|
|
|
# # # # #
|
|
|
|
. . # . .
|
|
|
|
. # . # .
|
|
|
|
# . . . #`);
|
|
|
|
case IconNames.Ghost: return images.createImage(`
|
|
|
|
. # # # .
|
|
|
|
# . # . #
|
|
|
|
# # # # #
|
|
|
|
# # # # #
|
|
|
|
# . # . #`);
|
|
|
|
case IconNames.Sword: return images.createImage(`
|
|
|
|
. . # . .
|
|
|
|
. . # . .
|
|
|
|
. . # . .
|
|
|
|
. # # # .
|
|
|
|
. . # . .`);
|
|
|
|
case IconNames.Giraffe: return images.createImage(`
|
|
|
|
# # . . .
|
|
|
|
. # . . .
|
|
|
|
. # . . .
|
|
|
|
. # # # .
|
|
|
|
. # . # .`);
|
|
|
|
case IconNames.Skull: return images.createImage(`
|
|
|
|
. # # # .
|
|
|
|
# . # . #
|
|
|
|
# # # # #
|
|
|
|
. # # # .
|
|
|
|
. # # # .`);
|
|
|
|
case IconNames.Umbrella: return images.createImage(`
|
|
|
|
. # # # .
|
|
|
|
# # # # #
|
|
|
|
. . # . .
|
|
|
|
# . # . .
|
|
|
|
# # # . .`);
|
|
|
|
case IconNames.Snake: return images.createImage(`
|
|
|
|
# # . . .
|
|
|
|
# # . # #
|
|
|
|
. # . # .
|
|
|
|
. # # # .
|
|
|
|
. . . . .`);
|
|
|
|
// animals
|
|
|
|
case IconNames.Rabbit: return images.createImage(`
|
|
|
|
# . # . .
|
|
|
|
# . # . .
|
|
|
|
# # # # .
|
|
|
|
# # . # .
|
|
|
|
# # # # .`);
|
|
|
|
case IconNames.Cow: return images.createImage(`
|
|
|
|
# . . . #
|
|
|
|
# . . . #
|
|
|
|
# # # # #
|
|
|
|
. # # # .
|
|
|
|
. . # . .`);
|
|
|
|
// musical notes
|
|
|
|
case IconNames.QuarterNote: return images.createImage(`
|
|
|
|
. . # . .
|
|
|
|
. . # . .
|
|
|
|
. . # . .
|
|
|
|
# # # . .
|
|
|
|
# # # . .`);
|
|
|
|
case IconNames.EigthNote: return images.createImage(`
|
|
|
|
. . # . .
|
|
|
|
. . # # .
|
|
|
|
. . # . #
|
|
|
|
# # # . .
|
|
|
|
# # # . .`);
|
|
|
|
// other icons
|
|
|
|
case IconNames.Pitchfork: return images.createImage(`
|
|
|
|
# . # . #
|
|
|
|
# . # . #
|
|
|
|
# # # # #
|
|
|
|
. . # . .
|
|
|
|
. . # . .`);
|
|
|
|
case IconNames.Target: return images.createImage(`
|
|
|
|
. . # . .
|
|
|
|
. # # # .
|
|
|
|
# # . # #
|
|
|
|
. # # # .
|
|
|
|
. . # . .`);
|
2020-09-11 14:18:32 +02:00
|
|
|
// arrows
|
|
|
|
case IconNames.ArrowNorth: return images.createImage(`
|
|
|
|
. . # . .
|
|
|
|
. # # # .
|
|
|
|
# . # . #
|
|
|
|
. . # . .
|
|
|
|
. . # . .`);
|
|
|
|
case IconNames.ArrowNorthEast: return images.createImage(`
|
|
|
|
. . # # #
|
|
|
|
. . . # #
|
|
|
|
. . # . #
|
|
|
|
. # . . .
|
|
|
|
# . . . .`);
|
|
|
|
case IconNames.ArrowEast: return images.createImage(`
|
|
|
|
. . # . .
|
|
|
|
. . . # .
|
|
|
|
# # # # #
|
|
|
|
. . . # .
|
|
|
|
. . # . .`);
|
|
|
|
case IconNames.ArrowSouthEast: return images.createImage(`
|
|
|
|
# . . . .
|
|
|
|
. # . . .
|
|
|
|
. . # . #
|
|
|
|
. . . # #
|
|
|
|
. . # # #`);
|
|
|
|
case IconNames.ArrowSouth: return images.createImage(`
|
|
|
|
. . # . .
|
|
|
|
. . # . .
|
|
|
|
# . # . #
|
|
|
|
. # # # .
|
|
|
|
. . # . .`);
|
|
|
|
case IconNames.ArrowSouthWest: return images.createImage(`
|
|
|
|
. . . . #
|
|
|
|
. . . # .
|
|
|
|
# . # . .
|
|
|
|
# # . . .
|
|
|
|
# # # . .`);
|
|
|
|
case IconNames.ArrowWest: return images.createImage(`
|
|
|
|
. . # . .
|
|
|
|
. # . . .
|
|
|
|
# # # # #
|
|
|
|
. # . . .
|
|
|
|
. . # . .`);
|
|
|
|
case IconNames.ArrowNorthWest: return images.createImage(`
|
|
|
|
# # # . .
|
|
|
|
# # . . .
|
|
|
|
# . # . .
|
|
|
|
. . . # .
|
|
|
|
. . . . #`);
|
2017-12-14 20:04:59 +01:00
|
|
|
default: return images.createImage(`
|
2017-02-28 18:50:29 +01:00
|
|
|
. . . . .
|
|
|
|
. . . . .
|
|
|
|
. . . . .
|
|
|
|
. . . . .
|
|
|
|
. . . . .
|
2017-12-14 20:04:59 +01:00
|
|
|
`);
|
2017-02-28 18:50:29 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-04-04 18:53:29 +02:00
|
|
|
//% weight=50 blockGap=8
|
|
|
|
//% help=images/arrow-number
|
|
|
|
//% blockId=device_arrow block="%arrow"
|
|
|
|
//% shim=TD_ID
|
|
|
|
//% deprecated=true
|
|
|
|
export function arrowNumber(arrow: ArrowNames): number {
|
|
|
|
return arrow;
|
|
|
|
}
|
2017-02-28 18:50:29 +01:00
|
|
|
}
|