BangleApps/apps/_example_widget/widget.js

15 lines
660 B
JavaScript
Raw Permalink Normal View History

2023-05-11 09:27:27 +00:00
/* run widgets in their own function scope if they need to define local
variables so they don't interfere with currently-running apps */
(() => {
2020-02-07 17:09:18 +00:00
// add your widget
WIDGETS["mywidget"]={
2022-06-16 12:39:31 +00:00
area:"tl", // tl (top left), tr (top right), bl (bottom left), br (bottom right), be aware that not all apps support widgets at the bottom of the screen
width: 28, // how wide is the widget? You can change this and call Bangle.drawWidgets() to re-layout
2023-05-11 09:27:27 +00:00
draw:function() {
g.reset(); // reset the graphics context to defaults (color/font/etc)
// add your code
g.drawString("X", this.x, this.y);
} // called to draw the widget
};
})()