add one image to make it spiffy

This commit is contained in:
Tom Ball 2017-01-30 16:42:48 -08:00
parent f944af8122
commit ff7b229a3a
2 changed files with 30 additions and 29 deletions

View File

@ -55,6 +55,7 @@
"Gesture.TiltLeft|block": "tilt left",
"Gesture.TiltRight": "Raised when the screen is pointing right",
"Gesture.TiltRight|block": "tilt right",
"IconNames.Heart|block": "heart",
"LedSpriteProperty.Blink|block": "blink",
"LedSpriteProperty.Brightness|block": "brightness",
"LedSpriteProperty.Direction|block": "direction",
@ -121,7 +122,7 @@
"game|block": "game",
"images.createBigImage|block": "create big image",
"images.createImage|block": "create image",
"images|block": "happy",
"images|block": "images",
"input.acceleration|block": "acceleration (mg)|%NAME",
"input.buttonIsPressed|block": "button|%NAME|is pressed",
"input.compassHeading|block": "compass heading (°)",

View File

@ -1,7 +1,5 @@
// this doesn't work//% block=happy enumval=0 blockImage=1
namespace images {
export enum IconNames {
enum IconNames {
//% enumval=0 block="heart" blockImage=1
Heart = 0,
SmallHeart,
@ -49,6 +47,32 @@ export enum IconNames {
SmallSquare
}
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 {
export enum ArrowNames {
North = 0,
NorthEast,
@ -649,27 +673,3 @@ export enum HourNames {
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)
}
}