p5 sketches are split into five sections:
Code before the setup.
The setup code.
Code between setup and draw.
The draw code.
Code after draw.
The p5 function automatically determines where an illustrating function
should be added. You can use sketch
along with the pre, setup,
between, draw, and post functions in order to explicitly specify where
illustrating functions should be added.
1 2 |
pre |
A pre sketch. |
setup |
A setup sketch. |
between |
A between sketch. |
draw |
A draw sketch. |
post |
A post sketch. |
width |
Width of the sketch. |
height |
Height of the sketch. |
padding |
Padding of the sketch. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.