2 ms·
Thank you for your advice! > If possible, avoid lots of canvas calls. For example, if you want to draw something simple like a bunch of boxes on the screen, gr
by dom96 7y ago
Thank you for your advice!
> If possible, avoid lots of canvas calls. For example, if you want to draw something simple like a bunch of boxes on the screen, grab the pixel array from the canvas and manipulate it directly, don't call `ctx.rect` in a for loop.
I think this is likely what's causing me the most trouble. The problem is that my game needs to draw many hundreds of circles, each of different colors/sizes. Perhaps I need to pre-render these to an off-screen canvas and then do some blitting.
I'm also tempted now to try what someone else suggested and target WebGL instead (likely via Pixi.js).