Skip to content

Instantly share code, notes, and snippets.

@mamachanko
Created January 23, 2017 11:28
Show Gist options
  • Save mamachanko/c5717513cbdd7bb2b1a9c2ff4b611d9b to your computer and use it in GitHub Desktop.
Save mamachanko/c5717513cbdd7bb2b1a9c2ff4b611d9b to your computer and use it in GitHub Desktop.
Shape API
{"x": 100, "y": 100}
<html>
<head>
<script src="//cdnjs.cloudflare.com/ajax/libs/p5.js/0.5.6/p5.js"></script>
<script src="sketch.js"></script>
</head>
<body>
</body>
</html>
function setup() {
createCanvas(600, 400);
noStroke();
loadJSON("data.json", drawThis);
}
function drawThis(data) {
console.log(data);
background(40, 90, 200);
fill(128);
ellipse(data.x, data.y, 30, 30);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment