Skip to content

Commit 00e7515

Browse files
committed
docs: add example for #200
1 parent 464ab6d commit 00e7515

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

examples/instance/index.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<!doctype html>
2+
<head>
3+
<meta charset="UTF-8">
4+
<script src="https://unpkg.com/[email protected]/lib/p5.js"></script>
5+
<script src="https://unpkg.com/[email protected]"></script>
6+
</head>
7+
<body>
8+
<script src="main.js"></script>
9+
</body>

examples/instance/main.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
const sketch = (p) => {
2+
3+
p.setup = () => {
4+
p.createCanvas(100, 100, p.SVG);
5+
}
6+
7+
p.draw = () => {
8+
p.background(0);
9+
}
10+
11+
}
12+
13+
new p5(sketch, document.body);

0 commit comments

Comments
 (0)