Skip to content
Discussion options

You must be logged in to vote

After a quick test, I run P5.js without modification 😊
But this is a quick test and I guess there are probably issues with the P5 dependencies (maybe).
If you have any problem, share me your examples to help me identify the issues (if there is)

Below the example:
Try to install P5 npm package: npm i -S p5

import p5 from 'p5';

const s = 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);
  };
};

htmlEl.innerHTML = ''; // reset result div before rerun code
const P5 = new p5(s, htmlEl); // htmlEl is the HTML element injected by Znote as an entry point for t…

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@lsooxlla8
Comment options

Answer selected by lsooxlla8
Comment options

You must be logged in to vote
1 reply
@alagrede
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
enhancement New feature or request
2 participants