• Example:

    g.clear();

    g.drawString('test 1',68,55);

    Bangle.loadWidgets();
    Bangle.drawWidgets();

    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).

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

drawWidgets changes the coordinate system of the display

Posted by Avatar for MrTomErdnuss @MrTomErdnuss

Actions