get rid of images

This commit is contained in:
Tom Ball 2017-01-30 15:33:33 -08:00
parent 35225468e4
commit f944af8122
12 changed files with 56 additions and 71 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

View File

@ -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 (°)",

View File

@ -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)
}
}