1 decade ago by Befeltingu
Im a pretty big noob to impact and programming in general.
So I want to be able to click on an image outside of the canvas and have something happen. I should be able to do something like this right?
And have a function "click" inside MyGame in main.js. Should this work? I dont get any errors but nothing happens. I just have a ig.log() in the click function and ive included debug module.
Ive also tried using
This is pretty noob I know but what can you do.
Thanks for any help
So I want to be able to click on an image outside of the canvas and have something happen. I should be able to do something like this right?
<img onclick = "MyGame.click;" src ="" /img" id ="hud">
And have a function "click" inside MyGame in main.js. Should this work? I dont get any errors but nothing happens. I just have a ig.log() in the click function and ive included debug module.
Ive also tried using
var d = document.getElementById('hud'); d.onclick(function(){ig.log()}
This is pretty noob I know but what can you do.
Thanks for any help