• Ahh - unfortunately that's a known issue - that g.flip() forces the screen to stay on. The widget area flickering is expected too - basically the double buffer means you have two buffers that swap, and widgets may only be drawn to one of them (you could fix that with Bangle.drawWidgets();g.flip();Bangle.dra­wWidgets().

    What I'd suggest is the offscreen buffer as you say, with a palette which you could cycle (which would actually be more efficient to render anyway). Looking at it, it likely wouldn't have to be full-res - maybe 1/2 or 1/3 res?

    Something like this might do it:

    const imgGfx = Graphics.createArrayBuffer(w, h, 8);
    const pal = new Uint16Array(256);
    const img = {width: w, height: h, bpp: 8, palette: pal, buffer: imgGfx.buffer};
    //....
    g.drawImage(img, 0,24, {scale:2});
    

    Math.random isn't random enough

    Hmm, I'd be surprised about that to be honest. While it's Pseudo-random it's quite a well-used algorithm.

About

Avatar for Gordon @Gordon started