Function Draw p5.js
Function Draw p5.js
, draw(), mousePressed(), etc. (Except in the case where they are placed inside
functions that are called by one of these methods.) What this means is that when
declaring variables before setup(), you will need to assign them values inside
setup() if you wish to use p5 functions. For example:
var n;
function setup() {
createCanvas(100, 100);
n = random(100);
}
Not everything in Processing is implemented in p5.js, but we are working on it!
Right now there is no 3D, PShape or PFont equivalent. The camera model in p5js i
s yet very basic, with only eye position and no "look at" or axis direction. See
the reference for up to date documentation of what functions work.