Thank you Ganble, you're right it's not an issue with integers! You can probably tell I'm only a very amateur programmer!
In that case, setLCDOverlay doesn't work with negative numbers, but this time I have no idea why.
setLCDOverlay
An example run in the emulator (same results on watch):
img = Graphics.createArrayBuffer(100, 100, 8).setColor('#f00').fillRect(0, 0, 100, 100); var y = 0; Bangle.setLCDOverlay(img, 0, y);
Draw a 100px square, colour it red, display in on the overlay. Negative number doesn't work, see third screenshot of blank screen.
By contrast, g.drawImage(img, 0, y); does work with negative numbers! See screenshot with green square, drawn at y=-90.
g.drawImage(img, 0, y);
Sorry, didn't do enough experimenting with the basic drawImage call, not I only need to work out why setLCDOverlay doesn't work the same.
drawImage
4 Attachments
@Sir_Indy started
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Thank you Ganble, you're right it's not an issue with integers! You can probably tell I'm only a very amateur programmer!
In that case,
setLCDOverlay
doesn't work with negative numbers, but this time I have no idea why.An example run in the emulator (same results on watch):
Draw a 100px square, colour it red, display in on the overlay. Negative number doesn't work, see third screenshot of blank screen.
By contrast,
g.drawImage(img, 0, y);
does work with negative numbers! See screenshot with green square, drawn at y=-90.Sorry, didn't do enough experimenting with the basic
drawImage
call, not I only need to work out whysetLCDOverlay
doesn't work the same.4 Attachments