Create a gist now

Instantly share code, notes, and snippets.

@zawaFMS /sketch.html Secret
Created Jan 13, 2018

Embed
What would you like to do?
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width">
<script language="javascript" type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/p5.js/0.2.9/p5.min.js"></script>
</head>
<body>
<script>
var ptouchX;
var ptouchY;
function setup() {
createCanvas(displayWidth, displayHeight);
background(255);
strokeWeight(10)
stroke(0);
}
function draw() {
ptouchX = touches[0].x;
ptouchY = touches[0].y;
}
function touchMoved() {
line(touches[0].x, touches[0].y, ptouchX, ptouchY);
return false;
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment