1
0
mirror of https://github.com/Pomax/BezierInfo-2.git synced 2025-08-28 18:49:57 +02:00

figured out how to reuse sketches with data-attribute parameters

This commit is contained in:
Pomax
2020-08-26 21:56:58 -07:00
93 changed files with 5805 additions and 24390 deletions

View File

@@ -1,13 +1,14 @@
let curve;
setup() {
this.curve = new Bezier(this, 20, 250, 30, 20, 200, 250, 220, 20);
setMovable(this.curve.points);
curve = new Bezier(this, 20, 250, 30, 20, 200, 250, 220, 20);
setMovable(curve.points);
setSlider(`.slide-control`, `position`, 0.5);
}
draw() {
resetTransform();
clear();
const curve = this.curve;
curve.drawSkeleton();
curve.drawCurve();
@@ -53,9 +54,3 @@ draw() {
line(0, h-x, w, h-x);
}
}
onMouseMove() {
if (this.cursor.down) {
redraw();
}
}