Skip to content

Instantly share code, notes, and snippets.

@onomuta
Created December 26, 2017 05:14
Show Gist options
  • Select an option

  • Save onomuta/f5b409edfb9afb9b80282bbf4382d547 to your computer and use it in GitHub Desktop.

Select an option

Save onomuta/f5b409edfb9afb9b80282bbf4382d547 to your computer and use it in GitHub Desktop.
p5.js template
function setup() {
createCanvas(600, 400);
textSize(48);
textAlign(CENTER, CENTER);
fill(255);
}
var frame = 0;
function draw() {
background("#ed225d");
text("p5.js template", width / 2, height / 2);
rect(10,10,10,frame);
frame ++;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.5.16/p5.min.js"></script>
body { background-color: #333; }
canvas {
display: block;
margin: auto;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment