sketch.js is a tiny (~5k) boilerplate for creating JavaScript based creative coding experiments.
Check out the showcase.
Sketch.js handles all that tedious but necessary stuff that would normally slow you down - setting up an animation loop, creating and managing a graphics context for Canvas or WebGL, cross browser and device event binding and normalisation for mouse, touch and keyboard events, handling window resizes… You get the idea.
When creating a sketch, you specify a type (the default is Sketch.CANVAS
) and what you get back is an augmented instance of a CanvasRenderingContext2D
, WebGLRenderingContext
or Node
/ HTMLElement
. This gives you direct access to all the usual properties and methods of your chosen context, as well as some new and useful ones added by sketch.js
It also provides fast global access to useful math functions and constants and extends random
to handle ranges and arrays.
For more information, check out the getting started guide, the API or the full source, as well as the examples in the showcase.
Have fun!