The clear() function clears a pixels buffer. Even if this buffers concept doesn't exist in Processing.js, adding a function that does nothing will be better than having code examples that won't run.
Then used in setup and draw as below, an error message is not thrown that I can catch. The error message generated below is logged in the browser console from processing.min.js:896, version 1.6.0. I am not able to catch this one using the same code as above.
Activity
Pomax commented on Sep 4, 2016
odd that it's not in already, given that PGraphics is supported (at least the Processing 2.0 API version). Marking as good first bug.
JamesWClark commented on Sep 4, 2016
This is the code snippet I was looking at.
In the above example, I can try to instantiate a Processing object and catch its error and use it on my page.
try { new Processing(canvas, code); } catch (err) { $('#error-message').html(err); }Then used in setup and draw as below, an error message is not thrown that I can catch. The error message generated below is logged in the browser console from processing.min.js:896, version 1.6.0. I am not able to catch this one using the same code as above.
void setup() { size(200,200,P3D); } void draw() { clear(); box(125,125,125); }