Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

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?
<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

1 decade ago by stillen

isn't it:

ig.game.functionName() or ig.game.MyGame.FunctionName()

It's one of these, just not by my dev box to check.

1 decade ago by Befeltingu

Oh ya duh ok thanks that did it. I thought it was something else because I wasnt getting an error. Thanks for the reply
Page 1 of 1
« first « previous next › last »