I've tried but still came to the opinion that if you need a complex interface,
it is better to do it on html and not on the canvas.
Complex animated element or set of elements that are already in the default html to paint on the canvas is just awful.
For example, scroll bars or a set of cards - you just want to hang myself if all this stuff into arrays and do other manipulations in the head to understand where the elements
well, generally studying this issue , reading books, stackoverflow, looking at examples of other projects,
I still came to the conclusion that it is best practice to make the complex interface beyond the canvas and do it in html this opens up a huge world context menu, modal Windows, tooltips and other beautiful elements
I implement it the following way - create div#gui and all the controls already put it
I put it hagher than main div and give it all propertyes as #wade_main_div, only give bigger z-index and pointer-events:none to not disable canvas
buttons in div #gui has css-propery pointer-events:auto; and i warite listeners in hud.js file for it.
in principle, very easy to align the coordinates of objects of Wade and the cursor position on the screen
wade.app.showHud = function() {
gui.style.display = 'block';
gui.style.width = container.style.width;
gui.style.height = container.style.height;
}
but it's hard to manage the interactions with the elements - for example the onclick works fine, but not mobile - you have to hang up the handler for touchstart/touchend html buttons
here's the question-how is it possible to implement directly in wade_input_manager model of interaction with the html layer? and actually given that we have a cycle update we could create a reactive model is not worse react.js or vue.js have you ever thought about it?