I was wondering how you would make a grid in a javascript canvas, a 10 pixel by 10 pixel grid for a game I am making
thank you for your response.
I was wondering how you would make a grid in a javascript canvas, a 10 pixel by 10 pixel grid for a game I am making
thank you for your response.
Well... you can read about the API...
https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API
You split your "canvas area" into the dimensions of your grid requirements, and you draw lines or just use math :-/
You can also look at this fine demo:
http://codepen.io/solartic/pen/qEGqNL
(not mine. This is done kindly by Kimani Walters)
And then there's this:
http://codereview.stackexchange.com/questions/114702/drawing-a-grid-on-canvas
So... really.. my answer is "just google it" and you will find a bunch of examples.
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.