JeZxLee Posted July 19, 2017 Share Posted July 19, 2017 Hi, Can someone look at my code HERE. (source code is clean) I've got 6 on screen clickable button sprites but they do not function? There are no errors in browser console. Demo can be played HERE. Thanks! JeZxLee Quote Link to comment Share on other sites More sharing options...
themoonrat Posted July 19, 2017 Share Posted July 19, 2017 Ok, there's a couple of crazy things there In input.js, you are joining the pointerdown and pointerup event EVERY FRAME. You only join the event once. In initialize.js, the function you are passing does not exist in that file scope Button[index].on( 'pointerdown', onClickButton(index) ); The way you use the function callback also won't work. You need to supply a reference to a function, or an anonymous function, as that parameter. You are actually trying to call that function there and then Quote Link to comment Share on other sites More sharing options...
JeZxLee Posted July 19, 2017 Author Share Posted July 19, 2017 Go it working, many thanks! URL's above are updated with new working build... JeZxLee Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.