I'm making a HTML/JS/CSS game and have came to stop! I'm not sure how I would use the 'onmouseover' tag with an element within my canvas. Please Help!
TRIED:
particle.onmouseover=function(){myScript};
Here's what I have so far:
for (var i = 0; i < 100; i++) { //add particles with random postions
particles.push(new creat_particle());
}
//function for multiple particles
function creat_particle() {
this.x = Math.random() * W;
this.y = Math.random() * H;
//Random Color
var r = Math.random() * 255 >> 0;
var g = Math.random() * 255 >> 0;
var b = Math.random() * 255 >> 0;
this.color = "rgba(" + r + "," + g + "," + b + ",0.5)";
//random size
this.radius = Math.random() * 45 + 5;
}
Any help appreciated...