Skip to content

Latest commit

History

21 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

grid.js

Draws a grid in your html5 canvas - See demo

Usage

Get a reference to the JavaScript file in the page head:

<scripttype="text/javascript" src="dist/grid.js"></script>

Assume that we have a HTML5 canvas element:

<canvasid="myCanvas" width="350" height="200"></canvas>

Use grid in JavaScript code like this when you want to pass your own options:

varcanvas=document.getElementById("myCanvas");varcontext=canvas.getContext("2d");varopts={distance : 20,lineWidth : 1.5,gridColor : "green",caption : true};newGrid(opts).draw(context);

or like this without options:

varcanvas=document.getElementById("myCanvas");varcontext=canvas.getContext("2d");newGrid().draw(context);

Demo

Have a look at the Demo page here

About

Will draw a nice grid on a HTML5 canvas element

Resources

Stars

55 stars

Watchers

5 watching

Forks

Releases

Packages

Contributors

Languages