This is a Processing concept thingy! Our “Global Mode” approach is strange to JS world!
Basically, it auto instantiates, then dumps & binds the whole p5 class to the global scope, which allows us to access them all w/o using the dot .
operator.
Yup! And that’s the standard way most apps do in the JS world!
Correct. However, we still can have multiple p5 “global mode” instances by placing them all inside separate <iframe>
tags, like I did below:
- https://GoSubRoutine.GitHub.io/Ball-in-the-Chamber
- GitHub - GoSubRoutine/Ball-in-the-Chamber: JS Native Modules coded in TS & CS
Do you mean my “Class p5 Extended” hack example?
B/c we have to pass our function sketch as its argument: new p5Plus(mySketch);
That sketch needs to be using the “instance mode” approach.