I want to stack two Canvas elements on top of each other. They are used for a game where the lower canvas will display the hexride, while the upper canvas is intended to display problems / orders (mainly arrows or highlighting in hexes - I do not want to redraw the massive hexride a million times) specified by the player.
The canvas is layered by zIndex 1/2.
However, the problem is this: orders displayed on the upper canvas must be drawn in response to the click and mousemove events on the lower canvas.
Obviously, by placing the “orders” canvas on top of the “hexgrid” canvas, any mousemove and click events will no longer fire using the “hexgrid” canvas, since it no longer receives events.
Is there a way to "forward", i.e. distributing events from one element to another element or what is another smart way to solve my problem?
source share