Screentweak (#214)
* adding pid * hiding functions * precision of value
This commit is contained in:
@ -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
|
||||
y |= 0
|
||||
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
|
||||
//% line.min=1 line.max=10
|
||||
export function showValue(name: string, value: number, line: number) {
|
||||
value = Math.round(value * 1000) / 1000;
|
||||
showString((name ? name + ": " : "") + value, line);
|
||||
}
|
||||
|
||||
@ -140,12 +141,9 @@ namespace brick {
|
||||
*/
|
||||
//% blockId=screen_show_image block="show image %image=screen_image_picker"
|
||||
//% weight=100 group="Screen" blockGap=8
|
||||
export function showImage(image: Image, delay: number = 400) {
|
||||
export function showImage(image: Image) {
|
||||
if (!image) return;
|
||||
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();
|
||||
}
|
||||
|
||||
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;
|
||||
y |= 0;
|
||||
w |= 0;
|
||||
|
Reference in New Issue
Block a user