Skip to content
Advertisement

Tag: processing.js

How can I use p5.js without it polluting the global scope?

I’m trying to convert some code I wrote for processing.js to use p5.js. In the existing code, I create an object with a statement like processing = new Processing(canvas, p => (p.draw = draw_frame)) with the canvas defined in HTML as <canvas id=”canvas”></canvas>, and any Processing functions and properties are attached to the processing object. For example, to draw a

Advertisement