GameMaker
Funox supports GameMaker (Studio 2 and later) HTML5 exports via an official extension.
Install
- Download the latest
FunoxGameMaker.yyextensionfrom the Developer Portal. - In GameMaker:
Tools → Import Local Package…and select the file. - Open
Game Options → Main → Game options HTML5and tick Enable Funox SDK.
Initialize
In your boot script (e.g., a controller object's Create event):
1funox_init(2 function() { show_debug_message("Funox SDK ready"); },3 function(err) { show_debug_message("Init failed: " + string(err)); }4);Lifecycle
1funox_game_gameplay_start();2funox_game_gameplay_stop();3funox_game_loading_start();4funox_game_loading_stop();5funox_game_happytime();Video ads
1funox_ad_request("midgame",2 function() { audio_pause_all(); },3 function() { audio_resume_all(); },4 function(err) { audio_resume_all(); }5);Rewarded:
1funox_ad_request("rewarded",2 function() { audio_pause_all(); },3 function() { audio_resume_all(); grant_reward(); },4 function(err) { audio_resume_all(); }5);Save data
1funox_data_set_item("highScore", "12450");2var score = funox_data_get_item("highScore"); // string or undefined3funox_data_remove_item("highScore");4funox_data_clear();User accounts
1funox_user_get(2 function(user) {3 if (user == undefined) {4 funox_user_show_auth_prompt(on_signin, on_error);5 } else {6 show_debug_message("Signed in as " + user.username);7 }8 },9 function(err) { show_debug_message("Error: " + string(err)); }10);11 12funox_user_get_token(function(token) {13 // send token to your backend14}, function(err) {});In-game purchases
1funox_user_get_xsolla_user_token(2 function(token) { open_store(token); },3 function(err) { show_debug_message("Error: " + string(err)); }4);Build settings
- Target: HTML5
- Splash screen: off (Funox doesn't allow custom splash)
- Texture page size: 2048 × 2048 or smaller
- Audio compression: Compressed - Streamed for music