p5.clickable icon indicating copy to clipboard operation
p5.clickable copied to clipboard

Make the librarie works in instance mode ?

Open GaelGuegan opened this issue 4 years ago • 0 comments

Is the librarie works in instance mode ? I tried it without success.

I have the following error :

Uncaught ReferenceError: fill is not defined
    draw http://localhost/.../p5.clickable.js:117

Here a link of what instance mode looks like : https://p5js.org/examples/instance-mode-instantiation.html

let sketch = function(p) {
  let x = 100;
  let y = 100;

  p.setup = function() {
    p.createCanvas(700, 410);
  };

  p.draw = function() {
    p.background(0);
    p.fill(255);
    p.rect(x, y, 50, 50);
  };
};

let myp5 = new p5(sketch);

GaelGuegan avatar Sep 24 '20 17:09 GaelGuegan