Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
ABNW
· 2y ago · 0 comments
Correct! Disable Pointer Events has surprising utility!
Comments
[–]
amelius
2y ago
What if you wanted to add the requirement that the user had to click on 1 specific piece of confetti?
[–]
nicky0
2y ago
Then you have a fun programming challenge.
[–]
MartijnHols
2y ago
Add a click event listener to the body and overlay the event-coordinates on the canvas.
[–]
amelius
2y ago
Will the canvas allow you to hit-test the confetti piece given the coordinate?
[–]
eyelidlessness
2y ago
Canvas draws raster images, anything resembling an object in your drawing logic is already tracked separately by necessity. So regardless, you’d presumably check against whatever data model you’re using to determine what to draw.