I believe if you give the element a background colour, it should get cleared properly:
var Layout = require("Layout"); var clockLayout = new Layout( { type:"txt", font:"15%", label:"Hello World", id:"clock", bgCol:g.theme.bg }); const utils = { random_element: function(array) { return array[Math.floor(Math.random() * array.length)];} }; const words = { approx: ['\'Bout', 'About', 'Around', `Summat\nlike`, 'Near', 'Close to'], }; function draw() { clockLayout.clear(); clockLayout.clock.label = utils.random_element(words.approx) + "\nHalf past\nnine"; clockLayout.render(); } g.clear(); // can put draw(); here Bangle.setUI("clock"); // Show launcher when middle button pressed Bangle.loadWidgets(); Bangle.drawWidgets(); draw(); Bangle.on('touch', function(button, xy) { if (button == 1); else{ draw(); } });
@Gordon 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.
I believe if you give the element a background colour, it should get cleared properly: