We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5ddc829 commit 91e9a21Copy full SHA for 91e9a21
screen.ts
@@ -137,18 +137,17 @@ namespace user_interface_base {
137
}
138
139
140
+ /**
141
+ * This doesn't use the address of the bitmaps in memory, it is a naive solution.
142
+ */
143
public static drawTransparentImage(from: Bitmap, x: number, y: number) {
- let index = 0;
-
144
for (let i = 0; i < this.bitmapCache.length; i++) {
145
if (this.bitmapCache[i] == from) {
- index = i;
146
- break;
+ radio.sendBuffer(Buffer.fromArray([SCREEN_FN_ID_DRAW_TRANSPARENT_IMAGE, i, x, y]));
147
+ this.waitForAck();
148
+ return;
149
150
- basic.showNumber(index);
- radio.sendBuffer(Buffer.fromArray([SCREEN_FN_ID_DRAW_TRANSPARENT_IMAGE, index, x, y]));
151
- this.waitForAck();
152
153
154
0 commit comments