You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+45-38
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,7 @@
1
1
## What Is This Project?
2
2
3
+
**FIRST AND FOREMOST**, this project is largely based on Matt DesLaurier's [`canvas-sketch`](https://github.com/mattdesl/canvas-sketch).
4
+
3
5
This project is an attempt to be an accessible, low barrier to entry sketchbook for generative art. The styling is minimal, and the rest of the opinionated pieces _should_ be largely abstracted away.
4
6
5
7
## Getting Started
@@ -56,22 +58,24 @@ import SketchWrapper from 'components/SketchWrapper'
56
58
import { NextPage } from'next'
57
59
import { ColorValue, Draw } from'types/CustomP5'
58
60
59
-
const width:number=2048
60
-
const height:number=2048
61
-
const dimensions:number[] = [width, height]
62
-
const padding:number[] = [40]
63
-
const background:ColorValue= [255, 253, 252]
64
-
65
-
const draw:Draw=p5=> {}
66
-
67
-
const MyNewSketch:NextPage= () => (
68
-
<SketchWrapper
69
-
draw={draw}
70
-
dimensions={dimensions}
71
-
padding={padding}
72
-
background={background}
73
-
/>
74
-
)
61
+
const MyNewSketch:NextPage= () => {
62
+
const width:number=2048
63
+
const height:number=2048
64
+
const dimensions:number[] = [width, height]
65
+
const padding:number[] = [40]
66
+
const background:ColorValue= [255, 253, 252]
67
+
68
+
const draw:Draw=p5=> {}
69
+
70
+
return (
71
+
<SketchWrapper
72
+
draw={draw}
73
+
dimensions={dimensions}
74
+
padding={padding}
75
+
background={background}
76
+
/>
77
+
)
78
+
}
75
79
76
80
exportdefaultMyNewSketch
77
81
```
@@ -80,7 +84,7 @@ You can navigate to this sketch by either finding it in the list of sketches on
80
84
81
85
## How Do I Work With p5 in This Environment?
82
86
83
-
You can treat any of your sketch pages as if you were writing a p5 sketch in [instance mode](https://www.youtube.com/watch?v=Su792jEauZg).
87
+
You can treat any of your sketch pages as if you were writing a p5 sketch in [instance mode](https://www.youtube.com/watch?v=Su792jEauZg).
84
88
85
89
### Setup
86
90
@@ -91,29 +95,32 @@ import SketchWrapper from 'components/SketchWrapper'
We define a `setup` arrow function and perform whatever logic we'd like. We then need to pass that function to the `setup` prop in the `<SketchWrapper />` component. There is _a lot_ going on under the hood of the `<SketchWrapper />` that offers you some strong defaults. Maintaining the ratio of your sketch as you resize the window, being able to save sketches with `cmd + s` or `ctrl + s` depening on your OS, etc. **This functionality won't be overwritten by passing in new props**. You'd need to specifically override what these utility functions are doing. To get a feel for what's going on there, you can take a look in `./src/util/defaults`.
0 commit comments