You can use variables and functions that are directly or indirectly accessible from the global scope, from within a processing.js sketch. Is there a way to give it a different object as the global scope to look stuff up in?
1 Answer
You're not being very specific so I'm just going to point you to the article that explains this on processingjs.org: http://processingjs.org/articles/PomaxGuide.html#interface
That explains how to make your sketch use JavaScript functions (don't access raw variables), and how to make JavaScript call your sketch functions (again, don't access raw variables, write a getter function and call that).
1 Comment
bigblind
What I was looking for, was how to limit the javascript functions a sketch can call, but I already found a different solution to my problem. Thank you for your help.
thisis enough, invoke withcallorapply.with, if their code gets declared/defined within it's code block.