Skip to content

Instantly share code, notes, and snippets.

@bharathvaj-ganesan
Created June 23, 2019 12:47
Show Gist options
  • Save bharathvaj-ganesan/9c656a64b2dbe0295c4d621ee06402d8 to your computer and use it in GitHub Desktop.
Save bharathvaj-ganesan/9c656a64b2dbe0295c4d621ee06402d8 to your computer and use it in GitHub Desktop.
let size = 500;
function setup() {
if (windowWidth < size) {
size = windowWidth; // p5.js property containing window width
}
createCanvas(size, size); // Creates a new canvas of given size
background(25); // adds color to canvas background
angleMode(DEGREES); // sets p5.js anglemode to degrees
noLoop(); // stop the draw function from executing continuously
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment