Closed
Description
Most appropriate sub-area of p5.js?
- Accessibility
- Color
- Core/Environment/Rendering
- Data
- DOM
- Events
- Image
- IO
- Math
- Typography
- Utilities
- WebGL
- Build process
- Unit testing
- Internationalization
- Friendly errors
- Other (specify if possible)
p5.js version
v1.11.5
Web browser and version
any
Operating system
any
Steps to reproduce this
_isGlobal
should be set to true when loading a global instance of p5 but it's always false in "init" addon methods.
This seems to have always been an issue in v1, not just in v1.11.5.
p5.prototype.registerMethod('init', function () {
console.log(this._isGlobal); // returns false incorrectly
});
p5.prototype.registerMethod('afterSetup', function () {
console.log(this._isGlobal); // returns true
});
function preload() {
console.log(_isGlobal); // returns true
}
function setup() {}
function draw() {}