Update public/sketch.js
Browse files- public/sketch.js +21 -20
public/sketch.js
CHANGED
@@ -41,33 +41,34 @@ function setup() {
|
|
41 |
AS.create_new_frame();
|
42 |
AS.display_frame(0);
|
43 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
});
|
45 |
|
46 |
-
canvas = createCanvas(512, 512);
|
47 |
-
canvas.id('canvas');
|
48 |
-
canvas.parent('canvas-ctn');
|
49 |
-
noLoop();
|
50 |
-
pixelDensity(1);
|
51 |
-
background('white');
|
52 |
-
|
53 |
|
54 |
|
55 |
-
Cursor = new OrientedCursor('canvas');
|
56 |
-
Cursor.catchCursor();
|
57 |
|
58 |
-
Pencil = new BrushPoint('pencil', 0, 0);
|
59 |
-
brushesPoints.push(Pencil);
|
60 |
|
61 |
|
62 |
-
|
63 |
-
canvas.mousePressed(function(){
|
64 |
-
Draws.startPath();
|
65 |
-
});
|
66 |
-
canvas.mouseReleased(function(){
|
67 |
-
Draws.endPath(Draws.drawGraphic, AS.frameGraphics);
|
68 |
-
Draws.drawings = [];
|
69 |
-
AS.update_frame();
|
70 |
-
});
|
71 |
|
72 |
} // END SETUP
|
73 |
|
|
|
41 |
AS.create_new_frame();
|
42 |
AS.display_frame(0);
|
43 |
}
|
44 |
+
Cursor = new OrientedCursor('canvas');
|
45 |
+
Cursor.catchCursor();
|
46 |
+
|
47 |
+
Pencil = new BrushPoint('pencil', 0, 0);
|
48 |
+
brushesPoints.push(Pencil);
|
49 |
+
|
50 |
+
canvas = createCanvas(512, 512);
|
51 |
+
canvas.id('canvas');
|
52 |
+
canvas.parent('canvas-ctn');
|
53 |
+
noLoop();
|
54 |
+
pixelDensity(1);
|
55 |
+
background('white');
|
56 |
+
|
57 |
+
canvas.mousePressed(function(){
|
58 |
+
Draws.startPath();
|
59 |
+
});
|
60 |
+
canvas.mouseReleased(function(){
|
61 |
+
Draws.endPath(Draws.drawGraphic, AS.frameGraphics);
|
62 |
+
Draws.drawings = [];
|
63 |
+
AS.update_frame();
|
64 |
+
});
|
65 |
});
|
66 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
|
68 |
|
|
|
|
|
69 |
|
|
|
|
|
70 |
|
71 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
|
73 |
} // END SETUP
|
74 |
|