0
How do I make a button in Html?
I'm making a platformer game using Html and JavaScript and I'm wondering how to make buttons on a canvas. Is it possible?
4 Answers
0
You can create image button with action functions on canvas. Check this out...
https://code.sololearn.com/W5Dw5pU0yjxn/?ref=app
0
you can draw the button in any way you like, its canvas after all.
but to detect an input, you can use event.clientX and event.clientY from onclick event and check if the coordinate are within the boundary of your button
0
Ok, thanks!