2012-02-01 3 views

답변

0

마우스 오버 캔버스 자체? 그냥 이벤트 리스너를 추가하고 장면 당신이 원하는 방식으로 다시 그리기 :

// Every time the mouse comes over the canvas the radius increases. 
// you could even add a timer so that every time the mouse stays over 
// the canvas the radius continues to increase constantly 
can.addEventListener('mouseover', function(e) { 
    radius += 10; 
    ctx.clearRect(0,0,can.width, can.height); 
    ctx.beginPath(); 
    ctx.arc(150, 150, radius, 0, Math.PI*.8, false); 
    ctx.stroke(); 
}, false); 

http://jsfiddle.net/dAQdL/

마우스 오버 캔버스에 그려진 "개체를?" 너는 add object persistence and detection to the canvas 일거야.

관련 문제