File tree 3 files changed +39
-1
lines changed
3 files changed +39
-1
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,10 @@ import './core/friendly_errors/sketch_reader';
8
8
import shape from './shape' ;
9
9
shape ( p5 ) ;
10
10
11
+ // shapes
12
+ import customShapes from './shape' ;
13
+ customShapes ( p5 ) ;
14
+
11
15
//accessibility
12
16
import accessibility from './accessibility' ;
13
17
accessibility ( p5 ) ;
Original file line number Diff line number Diff line change
1
+ /**
2
+ * @module Shape
3
+ * @submodule Custom Shapes
4
+ * @for p5
5
+ * @requires core
6
+ * @requires constants
7
+ */
8
+
9
+ // declare MyClass
10
+
11
+ function customShapes ( p5 , fn ) {
12
+
13
+ // ---- FUNCTIONS ----
14
+
15
+ // documentation here
16
+
17
+ // fn.myFunction = function() {
18
+ // this.background('yellow'); // call an existing p5 function
19
+ // };
20
+
21
+ // ---- CLASSES ----
22
+
23
+ // documentation here
24
+
25
+ // p5.MyClass = MyClass;
26
+ }
27
+
28
+ export default customShapes ;
29
+
30
+ if ( typeof p5 !== 'undefined' ) {
31
+ customShapes ( p5 , p5 . prototype ) ;
32
+ }
Original file line number Diff line number Diff line change @@ -2,10 +2,12 @@ import primitives from './2d_primitives.js';
2
2
import attributes from './attributes.js' ;
3
3
import curves from './curves.js' ;
4
4
import vertex from './vertex.js' ;
5
+ import customShapes from './custom_shapes.js' ;
5
6
6
7
export default function ( p5 ) {
7
8
p5 . registerAddon ( primitives ) ;
8
9
p5 . registerAddon ( attributes ) ;
9
10
p5 . registerAddon ( curves ) ;
10
11
p5 . registerAddon ( vertex ) ;
11
- }
12
+ p5 . registerAddon ( customShapes ) ;
13
+ }
You can’t perform that action at this time.
0 commit comments