Most recent activity
-
-
-
Hello everyone,
2 questionsI've written my own clock face and added a daily step count to the screen by using Bangle.getStepCount() but this just seems to just keep incrementing and not resetting to zero at the start of each day.
Should it reset to zero?
I've loaded the Pedometer widget, which does seem to reset but any suggestions on how I might use that step count on the screen rather than as a widget?
-
-
Hi, I've written my own clock app and have a background image that I'm adding the time and date on top of, however, whenever the time updates the background for the text "box" becomes white and coversthat part of the image.
This is when I use 'true' as the 4th argument to drawString, if I change it to 'false' the image is shown properly but overtime the time become 88:88. I've got around it by clearing the screen and rewriting the image and text every time the screen is updated.
In the clock example (https://www.espruino.com/Bangle.js+Clock) it says that 'true', by default, only redraws the text, so I was expecting the background image to still fill the screen.
Is there something I've missed, when using drawString or do I have to stick with my workaround?Rick
Thanks for your help and the code example, I've now got the basics working.
I've added some coloured bars but this is what I've written.
function getSteps() {
if (WIDGETS.wpedom !== undefined) {
}
return '????';
}
g.clear(); // Clear the screen once, at startup
// Load widgets
Bangle.loadWidgets();
//Set background
// top box
g.setColor("#00f"); //blue
g.fillRect(0, 0, 176, 58);
// middle box
g.setColor("#ff0"); //yellow
g.fillRect(0, 60, 176, 118);
// bottom box
g.setColor("#f00"); //red
g.fillRect(0, 120, 176, 176);
//Draw text string
g.setFontAlign(0, 0).setFont("Vector", 55);
g.drawString(getSteps(), 90, 95);