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?

8th Dec 2019, 3:12 AM
Lemonades For Sale
Lemonades For Sale - avatar
4 Answers
0
You can create image button with action functions on canvas. Check this out... https://code.sololearn.com/W5Dw5pU0yjxn/?ref=app
8th Dec 2019, 3:59 AM
CalviŐČ
CalviŐČ - avatar
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
8th Dec 2019, 4:02 AM
Taste
Taste - avatar
0
Ok, thanks!
8th Dec 2019, 4:03 AM
Lemonades For Sale
Lemonades For Sale - avatar