mouseover circle HTML5 canvas

后端 未结 2 391
花落未央
花落未央 2021-01-06 08:58

I am wondering how to set an area as a semi-complex shape (circle) defined in the canvas so when the user mouse overs the shape, a function will be called.

I do not

2条回答
  •  爱一瞬间的悲伤
    2021-01-06 09:37

    If you know where the mouse is and you know where the circle is on the canvas then the mouse is inside the circle when the distance from the mouse to the center of the circle is less that the radius. If that's true manually call what ever you need to call.

    Hope that helped

提交回复
热议问题