Ivatrix Posted March 3, 2015 Share Posted March 3, 2015 Hi I'm looking to add javascript functions to game maker for an API, but the format of them is like this:companyname.initialize({soundMuteCallback: muteSound, // optionalsoundUnmuteCallback: unmuteSound // optional});And in the file they look like thisthis.initialize = function(params) {companyname.getSharedEventCenter().postEvent(SharedEventKeys.API_INITIALIZE);_isInitialized = true;if (typeof params !== "undefined") {var muteSoundCallback = ("soundMuteCallback" in params && typeof params["soundMuteCallback"] === "function") ? params["soundMuteCallback"] : undefined;var unmuteSoundCallback = ("soundUnmuteCallback" in params && typeof params["soundUnmuteCallback"] === "function") ? params["soundUnmuteCallback"] : undefined;_adsManager.setSoundCallbacks(function() {typeof muteSoundCallback === "function" && muteSoundCallback();[].forEach.call(document.getElementsByTagName("audio"), function(element){element.muted = true;});}, function() {typeof unmuteSoundCallback === "function" && unmuteSoundCallback();[].forEach.call(document.getElementsByTagName("audio"), function(element){element.muted = false;});});}_tryShowAd();};Does anyone have any idea how to do this in game maker? I don't know what information to put in the extension function properties. 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.