Skip to content

Commit 1f24bfe

Browse files
authored
Map old touch functions to mouse functions
1 parent fe50da1 commit 1f24bfe

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/data.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
11
function addData(p5, fn){
2+
fn.touchStarted = function (...args) {
3+
return this.mousePressed(...args);
4+
};
5+
fn.touchEnded = function (...args) {
6+
return this.mouseReleased(...args);
7+
};
8+
fn.touchMoved = function (...args) {
9+
return this.mouseDragged(...args);
10+
};
11+
212
fn.append = function (array, value) {
313
array.push(value);
414
return array;
@@ -306,4 +316,4 @@ function addData(p5, fn){
306316

307317
if (typeof p5 !== undefined) {
308318
p5.registerAddon(addData);
309-
}
319+
}

0 commit comments

Comments
 (0)