0👍
Use only css as pointer-events: none;
function func(){
console.log("clicked");
}
#myCanvas{
border: 1px solid #000000;
pointer-events: none;
}
#myCanvas2{
border: 1px solid #000000;
}
<h2>With Css try to click me..</h2>
<canvas id="myCanvas" width="200" height="100" onclick="func()">
</canvas>
<h2>Without Css try to click me..</h2>
<canvas id="myCanvas2" width="200" height="100" onclick="func()">
</canvas>
- [Vuejs]-How can I disable buttons except to the button I click?
- [Vuejs]-Get data to Parent component from multi child components
0👍
Add in the css property pointer-events: none
0👍
If it’s only Construct2 problem I would say add condition to every on click event that checks if the cursor is NOT over HTML element to activate canvas events, and not activate if it is. Since I’m not quite sure where the problem occurs I’ll leave it at that, hope it helps!
- [Vuejs]-Socket.io dont update when i use chat rooms
- [Vuejs]-Pass a dynamic string value to vuelidate $v object – Vue
Source:stackexchange.com