I have been fiddling with this bit of code for hrs now and going round in circles and would like to ask for some pointers please.
The code below lets me place as many red dots as possible on a canvas with a bgd image, now what I am looking to do is have this layout but have links at the top of the canvas like so:
Link1->Green Dot Link2->Yellow Dot
And obviously when I click on each it will allow me to place yellow/green dots on the canvas alongside the red dots.
I am currently using html2canvas.js
Thanks again
$("#canvas").click(function(e){
getPosition(e);
});
var pointSize = 7;
function getPosition(event){
var rect = canvas.getBoundingClientRect();
var x = event.clientX - rect.left;
var y = event.clientY - rect.top;
drawCoordinates(x,y);
}
function drawCoordinates(x,y){
var ctx = document.getElementById("canvas").getContext("2d");
ctx.fillStyle = "#ff2626"; // Red color
ctx.beginPath();
ctx.arc(x, y, pointSize, 0, Math.PI * 2, true);
ctx.fill();
}