diff --git a/docs/static/blocks/iconnames/angry.PNG b/docs/static/blocks/iconnames/angry.PNG deleted file mode 100644 index 0198fc8a..00000000 Binary files a/docs/static/blocks/iconnames/angry.PNG and /dev/null differ diff --git a/docs/static/blocks/iconnames/asleep.PNG b/docs/static/blocks/iconnames/asleep.PNG deleted file mode 100644 index c9b9e14c..00000000 Binary files a/docs/static/blocks/iconnames/asleep.PNG and /dev/null differ diff --git a/docs/static/blocks/iconnames/confused.PNG b/docs/static/blocks/iconnames/confused.PNG deleted file mode 100644 index 851adf45..00000000 Binary files a/docs/static/blocks/iconnames/confused.PNG and /dev/null differ diff --git a/docs/static/blocks/iconnames/fabulous.PNG b/docs/static/blocks/iconnames/fabulous.PNG deleted file mode 100644 index f2fe8206..00000000 Binary files a/docs/static/blocks/iconnames/fabulous.PNG and /dev/null differ diff --git a/docs/static/blocks/iconnames/happy.PNG b/docs/static/blocks/iconnames/happy.PNG deleted file mode 100644 index 24fa199a..00000000 Binary files a/docs/static/blocks/iconnames/happy.PNG and /dev/null differ diff --git a/docs/static/blocks/iconnames/meh.PNG b/docs/static/blocks/iconnames/meh.PNG deleted file mode 100644 index 203d2e6c..00000000 Binary files a/docs/static/blocks/iconnames/meh.PNG and /dev/null differ diff --git a/docs/static/blocks/iconnames/sad.PNG b/docs/static/blocks/iconnames/sad.PNG deleted file mode 100644 index d9c40aa6..00000000 Binary files a/docs/static/blocks/iconnames/sad.PNG and /dev/null differ diff --git a/docs/static/blocks/iconnames/silly.PNG b/docs/static/blocks/iconnames/silly.PNG deleted file mode 100644 index a5b3d812..00000000 Binary files a/docs/static/blocks/iconnames/silly.PNG and /dev/null differ diff --git a/docs/static/blocks/iconnames/smallheart.PNG b/docs/static/blocks/iconnames/smallheart.PNG deleted file mode 100644 index 66aec605..00000000 Binary files a/docs/static/blocks/iconnames/smallheart.PNG and /dev/null differ diff --git a/docs/static/blocks/iconnames/surprised.PNG b/docs/static/blocks/iconnames/surprised.PNG deleted file mode 100644 index fa2b6a3c..00000000 Binary files a/docs/static/blocks/iconnames/surprised.PNG and /dev/null differ diff --git a/libs/core/_locales/core-strings.json b/libs/core/_locales/core-strings.json index 3200fe92..e0774809 100644 --- a/libs/core/_locales/core-strings.json +++ b/libs/core/_locales/core-strings.json @@ -55,17 +55,6 @@ "Gesture.TiltLeft|block": "tilt left", "Gesture.TiltRight": "Raised when the screen is pointing right", "Gesture.TiltRight|block": "tilt right", - "IconNames.Angry|block": "angry", - "IconNames.Asleep|block": "asleep", - "IconNames.Confused|block": "confused", - "IconNames.Fabulous|block": "fabulous", - "IconNames.Happy|block": "happy", - "IconNames.Heart|block": "heart", - "IconNames.Meh|block": "meh", - "IconNames.Sad|block": "sad", - "IconNames.Silly|block": "silly", - "IconNames.SmallHeart|block": "smallheart", - "IconNames.Surprised|block": "surprised", "LedSpriteProperty.Blink|block": "blink", "LedSpriteProperty.Brightness|block": "brightness", "LedSpriteProperty.Direction|block": "direction", @@ -132,7 +121,7 @@ "game|block": "game", "images.createBigImage|block": "create big image", "images.createImage|block": "create image", - "images|block": "images", + "images|block": "happy", "input.acceleration|block": "acceleration (mg)|%NAME", "input.buttonIsPressed|block": "button|%NAME|is pressed", "input.compassHeading|block": "compass heading (°)", diff --git a/libs/core/icons.ts b/libs/core/icons.ts index ef0395a9..a3e4ac44 100644 --- a/libs/core/icons.ts +++ b/libs/core/icons.ts @@ -1,32 +1,23 @@ // this doesn't work//% block=happy enumval=0 blockImage=1 +namespace images { -enum IconNames { - //% enumval=0 block="heart" blockImage=1 +export enum IconNames { Heart = 0, - //% enumval=1 block="smallheart" blockImage=1 SmallHeart, - //% enumval=2 block="happy" blockImage=1 - Happy, - //% enumval=3 block="sad" blockImage=1 - Sad, - //% enumval=4 block="confused" blockImage=1 - Confused, - //% enumval=5 block="angry" blockImage=1 - Angry, - //% enumval=6 block="asleep" blockImage=1 - Asleep, - //% enumval=7 block="surprised" blockImage=1 - Surprised, - //% enumval=8 block="silly" blockImage=1 - Silly, - //% enumval=5 block="fabulous" blockImage=1 - Fabulous, - //% enumval=5 block="meh" blockImage=1 - Meh, Yes, No, + Happy, + Sad, + Confused, + Angry, + Asleep, + Surprised, + Silly, + Fabulous, + Meh, + TShirt, Rollerskate, Duck, @@ -41,24 +32,24 @@ enum IconNames { Umbrella, Snake, - Triangle, - LeftTriangle, - Chessboard, - Diamond, - SmallDiamond, - Square, - SmallSquare, - Rabbit, Cow, QuarterNote, EigthNote, Pitchfork, Pacman, - Target + Target, + + Triangle, + LeftTriangle, + Chessboard, + Diamond, + SmallDiamond, + Square, + SmallSquare } -enum ArrowNames { +export enum ArrowNames { North = 0, NorthEast, East, @@ -69,7 +60,7 @@ enum ArrowNames { NorthWest, } -enum HourNames { +export enum HourNames { Hour12 = 0, Hour1, Hour2, @@ -85,33 +76,6 @@ enum HourNames { } -namespace basic { - - //% weight=50 - //% blockId=basic_show_arrow block="show arrow %i=device_arrow" - export function showArrow(i: number) { - let res = images.arrowImage(i) - res.showImage(0) - } - - //% weight=50 - //% blockId=basic_show_hour block="show hour %i=device_hour" - export function showHour(i: number) { - let res = images.hourImage(i) - res.showImage(0) - } - - //% weight=90 - //% blockId=basic_show_icon block="show icon %i" - export function showIcon(i: IconNames) { - let res = images.iconImage(i) - res.showImage(0) - } -} - -namespace images { - - const heart = ` . # . # . # # # # # @@ -662,6 +626,14 @@ namespace images { case IconNames.Pitchfork: return set(res, pitchfork) case IconNames.Pacman: return set(res, pacman) case IconNames.Target: return set(res, target) + + case IconNames.Triangle: return set(res, triangle) + case IconNames.LeftTriangle: return set(res, left_triangle) + case IconNames.Chessboard: return set(res, chessboard) + case IconNames.Diamond: return set(res, diamond) + case IconNames.SmallDiamond: return set(res, small_diamond) + case IconNames.Square: return set(res, square) + case IconNames.SmallSquare: return set(res, small_square) } return res; } @@ -677,3 +649,27 @@ namespace images { return res } } + +namespace basic { + + //% weight=50 + //% blockId=basic_show_arrow block="show arrow %i=device_arrow" + export function showArrow(i: number) { + let res = images.arrowImage(i) + res.showImage(0) + } + + //% weight=50 + //% blockId=basic_show_hour block="show hour %i=device_hour" + export function showHour(i: number) { + let res = images.hourImage(i) + res.showImage(0) + } + + //% weight=90 + //% blockId=basic_show_icon block="show icon %i" + export function showIcon(i: images.IconNames) { + let res = images.iconImage(i) + res.showImage(0) + } +}