g.drawString('test 2',68,55); // this is now drawn slightly higher and left
Hi - yes, this is because the font/alignment/colour/etc can be changed by whatever widgets are being drawn. Sometimes they even redraw themselves automatically (eg when the charger is plugged in the battery widget redraws).
To work around this it's good practice to use g.reset() in a function before you draw anything - it resets all the graphics settings to the default (without clearing the screen) so you you're working from a known state.
Good to know. Thx
Ooh, thanks for the question @MrTomErdnuss and the tip @Gordon. I was wondering why my widgets were not refreshing (or coming up at the wrong place if I called Bangle.drawWidgets() everytime the screen came on).
Don't worry about formatting, just type in the text and we'll take care of making sense of it. We will auto-convert links, and if you put asterisks around words we will make them bold.
For a full reference visit the Markdown syntax.
© Espruino, powered by microcosm.
Report a problem