p5 sketches are split into five sections:
1. Code before the [setup]. 2. The [setup] code. 3. Code between [setup] and [draw]. 4. The [draw] code. 5. 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.