canvas-sketch
canvas-sketch copied to clipboard
Render on demand
It would be nice if there would be a possibility to add rendering on demand through a callback. Is there a way to make a custom render method, where the requestAnimationFrame function is available?
I’ve also wanted this feature at times. What I tend to do is run the async canvasSketch function, then stop() the SketchManager instance that gets returned, and manually call render() and resize() functions as needed.
Actually - simpler would just be to set animate to true and playing to false in the settings. No need to stop that way or worry about resize, and you can call props.render() from within your sketch to trigger a new render manually.