タッチして、mouseX、mouseY、pmouseX、pmouseYの値を使用して画面に描画します。
touch drawing input
Mobile Drawing
View Source Code
/*
* @name Simple Draw
* @description Touch to draw on the screen using mouseX, mouseY, pmouseX, and pmouseY values.
*/
function setup() {
// createCanvas(displayWidth, displayHeight);
createCanvas(windowWidth, windowHeight);
strokeWeight(10);
stroke(0);
}
function touchMoved() {
line(mouseX, mouseY, pmouseX, pmouseY);
return false;
}
License
Source code is available on GitHub p5.js website legacy.
All examples are licensed under CC BY-NC-SA 4.0.