Skip to content

Commit

Permalink
commit message (#7368)
Browse files Browse the repository at this point in the history
  • Loading branch information
GregStanton authored Nov 9, 2024
1 parent b66247f commit 5b12d51
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ import './core/friendly_errors/sketch_reader';
import shape from './shape';
shape(p5);

// shapes
import customShapes from './shape';
customShapes(p5);

//accessibility
import accessibility from './accessibility';
accessibility(p5);
Expand Down
32 changes: 32 additions & 0 deletions src/shape/custom_shapes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/**
* @module Shape
* @submodule Custom Shapes
* @for p5
* @requires core
* @requires constants
*/

// declare MyClass

function customShapes(p5, fn) {

// ---- FUNCTIONS ----

// documentation here

// fn.myFunction = function() {
// this.background('yellow'); // call an existing p5 function
// };

// ---- CLASSES ----

// documentation here

// p5.MyClass = MyClass;
}

export default customShapes;

if (typeof p5 !== 'undefined') {
customShapes(p5, p5.prototype);
}
4 changes: 3 additions & 1 deletion src/shape/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ import primitives from './2d_primitives.js';
import attributes from './attributes.js';
import curves from './curves.js';
import vertex from './vertex.js';
import customShapes from './custom_shapes.js';

export default function(p5){
p5.registerAddon(primitives);
p5.registerAddon(attributes);
p5.registerAddon(curves);
p5.registerAddon(vertex);
}
p5.registerAddon(customShapes);
}

0 comments on commit 5b12d51

Please sign in to comment.