Skip to content

Unlock custom brushes, natural fill effects and intuitive hatching in p5.js

New folder structure

Alejandro6402cac6d142
diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index c96066d..0000000
--- a/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/.DS_Store
\ No newline at end of file
diff --git a/p5.min.js b/dependencies/p5.min.js
similarity index 100%
rename from p5.min.js
rename to dependencies/p5.min.js
diff --git a/spectral.min.js b/dependencies/spectral.min.js
similarity index 100%
rename from spectral.min.js
rename to dependencies/spectral.min.js
diff --git a/example.html b/example.html
new file mode 100644
index 0000000..68675de
--- /dev/null
+++ b/example.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>p5.brush.js Example</title>
+ <script src="./dependencies/p5.min.js"></script>
+ <script src="./dependencies/spectral.min.js"></script>
+ <script src="./p5.brush.js"></script>
+ <link rel="stylesheet" href="./style.css">
+ </head>
+ <body>
+ <script src="./sketch.js"></script>
+ </body>
+</html>
\ No newline at end of file
diff --git a/index.html b/index.html
deleted file mode 100644
index 3f39750..0000000
--- a/index.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <title>Brushbox - Examples</title>
- <script src="./p5.min.js"></script>
- <script src="./spectral.min.js"></script>
- <script src="./p5.brush.js"></script>
- <link rel="stylesheet" href="./style.css">
- </head>
- <body>
- <script src="./examples.js"></script>
- </body>
-</html>
\ No newline at end of file
diff --git a/examples.js b/sketch.js
similarity index 99%
rename from examples.js
rename to sketch.js
index fe17821..c33e7a8 100644
--- a/examples.js
+++ b/sketch.js
@@ -56,7 +56,7 @@ brush.add("watercolor", {
curve: function (x) {return 1-x}, // If "custom", define the curve function with a curve equation from x = 0 to x = 1, returning values from 0 to 1
min_max: [0.5,1.2] // For both cases, define min and max pressure (reverse for inverted presure)
},
- // if you select the a custom type brush, define the tip geometry here. Use 0,0 as center of tip. If not, you can remove these lines.
+ // if you select the a custom type brush, define the tip geometry here. Use 0,0 as center of tip. If not, you can remove these lines.
tip: function () {
B.mask.rotate(45),B.mask.rect(-1.5,-1.5,3,3),B.mask.rect(1.5,1.5,1,1); // in this example, the tip would be two squares, rotated 45 degrees
},