html5, can collision be detected? _html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:14:44
Original
841 people have browsed it

1. I used html5 to randomly draw a few thick lines with fixed color types.
2. Can you tell whether the mouse has moved above the line?


Reply to the discussion (solution)

The drawn line must have some base points. Use mathematical knowledge to determine whether the event.X and event.Y of the mouse are on the line

This is okay, but can it determine the color at the current position of the mouse?

If it is the same color as the line, then it is judged that it is on the line. Is this okay?

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template