Skip to content

Instantly share code, notes, and snippets.

@Breefield
Created August 12, 2012 04:23
Show Gist options
  • Save Breefield/3329718 to your computer and use it in GitHub Desktop.
Save Breefield/3329718 to your computer and use it in GitHub Desktop.
Hexagon Canvas
<!DOCTYPE html>
<html lang='en'>
<head>
<title>Hexagon</title>
</head>
<body>
<!-- Create a canvas and give it the attribute "resize" this tells Paper.js the canvas should be the size of the entire browser window -->
<canvas id='background-hexagons' resize></canvas>
<!-- Include paperclip -->
<script src="/assets/libs/paper.js" type="text/javascript"></script>
<!-- Include the script the draws the hexagons, paperclip will load this page in and link it's context to the background-hexagons canvas element, cool! Notice the weird text/paperscript which is important for this to happen in the correct load order (paperclip includes this script after it's loaded, rather than the browser loading it) -->
<script canvas='background-hexagons' src='/assets/launcher/page.js' type='text/paperscript'></script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment