Starter template


This p5⁎js sketch serves as a template for most of my other sketches! It’s a simple starting point that includes a few features that I find useful for most sketches including:

  • a color palette that I tend to feature in my sketches. a setup() function that creates a canvas and sets the background color.

  • a draw() function that clears the canvas, sets the background color, and draws some text.

  • a keyPressed() function that pauses and resumes the animation when the spacebar is pressed and also saves a GIF or a still image of the canvas when the g or s key is pressed.

  • a windowResized() function that resizes the canvas when the window is resized.

You can copy this template and modify it to create your own starter sketch template. Have fun!