• Which bit is slow for you? The drawImage in the animate function?

    It's not helping that you have an image double the size of the screen - and it'll be iterating through every pixel (even the ones that are offscreen) I think.

    You could have just a single fullscreen graphics (for the new screen) and could then use g.scroll to scroll the existing screen contents off, and then draw the new graphics on? That could help by a factor of 2 or so I guess.

    It seems slightly counter-intuitive, but you could also use http://www.espruino.com/Reference#l_GrapĀ­hics_drawImages to draw just the single image, but just in the small area that's new.

    ... so for instance if you scroll by 8 pixels, you do g.scroll(-8,0) and then g.drawImages([{x:R.x-8, y:0, ...}], {x:R.w-8,y:0,width:8,height:R.h})

    It's slightly slower than drawImage but it allows you to render just an area of the image, which could help in this case


Avatar for Gordon @Gordon started