Skip to content

Make the librarie works in instance mode ?Β #22

@GaelGuegan

Description

@GaelGuegan

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);

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions