Controlling when a p5js sketch starts running

I've got a complex modern frontend web application which goes through a series of transformations to the DOM before reaching the "page" where I want to use p5.js.

However, p5.js automatically calls setup() and starts running as soon as the DOM is loaded. Is there a way to tell p5 not to run my sketch on DOM load and instead trigger it running through a specific API call at the right point in the lifecycle of my wider application?



Sign In or Register to comment.