Skip to content

Instantly share code, notes, and snippets.

@s-estay
Last active September 5, 2019 14:29
Show Gist options
  • Save s-estay/bb178c95bb3e75bfeed2d9c11fa1f01d to your computer and use it in GitHub Desktop.
Save s-estay/bb178c95bb3e75bfeed2d9c11fa1f01d to your computer and use it in GitHub Desktop.
P5js instance mode example
var sketch = function(p){
p.setup = function(){
p.createCanvas(p.windowWidth*0.8, 100);
}
p.draw = function(){
p.background(0);
}
p.windowResized = function(){
p.resizeCanvas(p.windowWidth*0.8, 100);
}
}
var myp5 = new p5(sketch, 'script-1');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment