Skip to content

Instantly share code, notes, and snippets.

@runemadsen
Created November 3, 2016 15:54
Show Gist options
  • Select an option

  • Save runemadsen/9dd770a39e5bf01ee9419c1c2d6e8e40 to your computer and use it in GitHub Desktop.

Select an option

Save runemadsen/9dd770a39e5bf01ee9419c1c2d6e8e40 to your computer and use it in GitHub Desktop.
var r = new Rune({
container: "#canvas",
width: 800,
height: 600
});
var myPoly = r.polygon(100, 100)
.lineTo(0, 0)
.lineTo(200, 150)
.lineTo(75, 400);
for(var x = 0; x < r.width; x+= 30) {
for(var y = 0; y < r.height; y+= 30) {
if(myPoly.contains(x, y))
r.circle(x, y, 15)
}
}
myPoly.removeParent();
r.play();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment