Skip to content

Commit 3969920

Browse files
committed
debugging
1 parent d7ec344 commit 3969920

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

screen.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ namespace user_interface_base {
1111

1212
export class Screen {
1313
private static image_: Bitmap
14+
private static bitmapCache: Bitmap[] = [];
1415

1516
public static WIDTH = screen().width
1617
public static HEIGHT = screen().height
@@ -132,14 +133,20 @@ namespace user_interface_base {
132133

133134
this.waitForAck();
134135
}
136+
this.bitmapCache.push(bitmap);
135137
}
136138

137139

138140
public static drawTransparentImage(from: Bitmap, x: number, y: number) {
139-
const hash = 0;
140-
141-
// TODO
141+
let index = 0;
142142

143+
for (let i = 0; i < this.bitmapCache.length; i++) {
144+
if (this.bitmapCache[i] == from) {
145+
index = i;
146+
break;
147+
}
148+
}
149+
basic.showNumber(index);
143150
radio.sendBuffer(Buffer.fromArray([SCREEN_FN_ID_DRAW_TRANSPARENT_IMAGE, 7, x, y]));
144151
this.waitForAck();
145152
}

0 commit comments

Comments
 (0)