export default function Sketch(p5) {
p5.setup = () => {
p5.createCanvas(300, 300);
p5.noFill();
p5.noLoop();
};
p5.draw = () => {
p5.background(0);
Easy to understand calulations - https://matthewdbill.medium.com/back-of-envelope-calculations-cheat-sheet-d6758d276b05
Power Approx Value (Bytes) Bytes
-----------------------------------------
10 1 thousand 1 KB
16 16 thousand 64 KB
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
(() => { | |
// get canvas by id | |
// get canvas by id | |
const canvas = document.querySelector("#myCanvas") | |
// overriding default width & height | |
canvas.width = 500 | |
canvas.height = 500 | |
// get 2d context of our canvas |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Super Simple Canvas</title> | |
<script src="sketch.js"></script> | |
</head> | |
<body> | |
<canvas id="myCanvas" height="500" width="500"></canvas> | |
</body> |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |