|
clickable grid on top of canvas
Ok, so lets say I'm trying to make a game that can be played on phone or computer. To do this I'm just going to use mousedown.
I'm creating a canvas, and then a <div> tag that will act as a grid over the canvas. I create an array like so,
var grid = [
'0000',
'0000',
'0000'
];
Now I programed the grid array to populate in the div tag sitting on top of the canvas. What happens on the canvas depends on which grid box is clicked. How can I detect which grid box is clicked? I know it's probably using "this" but I seem to have trouble using that. I DON'T WANT A JQUERY SOLUTION. After I do that, how can i find the position that that specific grid box is in? meaning the css left and top.
thanks
|