Created
October 28, 2020 19:51
-
-
Save sspboyd/4ba04a0a99f6a448f1104d1aceba70f1 to your computer and use it in GitHub Desktop.
Minimal P5.js Instance Mode template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const s = (p55) => { // using p55 to refer to the sketch - throwback to Processing megabucket era :) | |
// Declare some globals | |
let canvasW = 521; | |
let canvasH = 521; | |
p55.preload = () => { | |
// load any fonts, data, etc... | |
}; | |
p55.setup = () => { | |
p55.createCanvas(canvasW, canvasH); | |
}; | |
p55.draw = () => { | |
// including some example drawing code | |
p55.background(76, 123, 199); | |
p55.fill(255,199); | |
p55.noStroke(); | |
p55.rect(p55.mouseX, p55.mouseY, 47, 47); | |
}; | |
}; | |
let myp5 = new p5(s); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment