This commit is contained in:
Peli de Halleux 2018-01-08 15:13:20 -08:00
commit 85263fb84d
2 changed files with 6 additions and 7 deletions

View File

@ -4,7 +4,8 @@
This repo contains the editor target hosted at https://d541eec2-1e96-4b7b-a223-da9d01d0337a.pxt.io/ This repo contains the editor target hosted at https://d541eec2-1e96-4b7b-a223-da9d01d0337a.pxt.io/
Issue tracker: https://src.education.lego.com/groups/ev3-makecode LEGO Auth: https://src.education.lego.com/groups/ev3-makecode (use Google Authenticator)
LEGO Chat: https://chat.internal.education.lego.com/make-code/channels/town-square
## Local Dev setup ## Local Dev setup

View File

@ -58,7 +58,7 @@ namespace brick {
} }
} }
export function setPixel(on: boolean, x: number, y: number) { function setPixel(on: boolean, x: number, y: number) {
x |= 0 x |= 0
y |= 0 y |= 0
if (0 <= x && x < DAL.LCD_WIDTH && 0 <= y && y < DAL.LCD_HEIGHT) if (0 <= x && x < DAL.LCD_WIDTH && 0 <= y && y < DAL.LCD_HEIGHT)
@ -101,6 +101,7 @@ namespace brick {
//% weight=96 group="Screen" inlineInputMode="inline" blockGap=8 //% weight=96 group="Screen" inlineInputMode="inline" blockGap=8
//% line.min=1 line.max=10 //% line.min=1 line.max=10
export function showValue(name: string, value: number, line: number) { export function showValue(name: string, value: number, line: number) {
value = Math.round(value * 1000) / 1000;
showString((name ? name + ": " : "") + value, line); showString((name ? name + ": " : "") + value, line);
} }
@ -140,12 +141,9 @@ namespace brick {
*/ */
//% blockId=screen_show_image block="show image %image=screen_image_picker" //% blockId=screen_show_image block="show image %image=screen_image_picker"
//% weight=100 group="Screen" blockGap=8 //% weight=100 group="Screen" blockGap=8
export function showImage(image: Image, delay: number = 400) { export function showImage(image: Image) {
if (!image) return; if (!image) return;
image.draw(0, 0, Draw.Normal); image.draw(0, 0, Draw.Normal);
delay = Math.max(0, delay);
if (delay > 0)
loops.pause(delay);
} }
/** /**
@ -170,7 +168,7 @@ namespace brick {
screen.clear(); screen.clear();
} }
export function drawRect(x: number, y: number, w: number, h: number, mode = Draw.Normal) { function drawRect(x: number, y: number, w: number, h: number, mode = Draw.Normal) {
x |= 0; x |= 0;
y |= 0; y |= 0;
w |= 0; w |= 0;