kingsushi Posted May 13, 2014 Share Posted May 13, 2014 Hi EveryoneHow would I go about running some js code through clickable_add in GameMaker Studio?I have tried various things without success.Any help would be appreciated. Quote Link to comment Share on other sites More sharing options...
Filipp_BSG Posted May 17, 2014 Share Posted May 17, 2014 Have you tried to do this with using your JS code as an extension? Quote Link to comment Share on other sites More sharing options...
Rudrabhoj Bhati Posted May 17, 2014 Share Posted May 17, 2014 They are translating to JS in HTML5 module and C++ in YYC method, I really don't know why they don't allow direct inclusion of C++ and JS files and then allowing something like extern to allow use of functions/classes from cpp and js? Quote Link to comment Share on other sites More sharing options...
kingsushi Posted June 17, 2014 Author Share Posted June 17, 2014 Figured it out. You need to name the gml script gmcallback_* For instance, i would have a script called "gmcallback_test" and justhave that script executed when the clickable_add button is clicked Quote Link to comment Share on other sites More sharing options...
blueFire Posted February 22, 2015 Share Posted February 22, 2015 Is the script named "gmcallback_test" a script in an extension or a script created inside GMS with the create script button? Jason Quote Link to comment Share on other sites More sharing options...
kingsushi Posted February 22, 2015 Author Share Posted February 22, 2015 "gmcallback_test" is a script created inside of GMS. You would then call it with this:clickable_add(x,y,sprite_get_tpe(spr_test,0),"gmcallback_test()","","");The "gmcallback_test" script should be calling the external js functions. Hope this helped. Quote Link to comment Share on other sites More sharing options...
blueFire Posted February 22, 2015 Share Posted February 22, 2015 Yes, it helped very much. I combined the clickable_add() function, the gmcallback_test() internal script and the external JavaScript code (created and used in an extension) to make it work. Thank you. Jason Quote Link to comment Share on other sites More sharing options...
kingsushi Posted February 22, 2015 Author Share Posted February 22, 2015 My pleasure. Glad I could help 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.