HTML5

These functions are provided specifically for the HTML5 platform.

The HTML5 module has some functions that are specifically designed to be used by the games that target it, although it should be noted that some of them may also work for other target platforms too.

The available functions for HTML5 are:

  1. url_open
  2. url_open_ext
  3. url_open_full
  4. url_get_domain
  5. browser_height
  6. browser_width
  7. browser_input_capture
  8. webgl_enabled
  9. clickable_exists
  10. clickable_add
  11. clickable_add_ext
  12. clickable_change
  13. clickable_change_ext
  14. clickable_set_style
  15. clickable_delete

Apart from these functions for the HTML5 target module, there is also a special JavaScript variable that can be used on those rare occasions when the contents of the html5game folder are stored in a completely different place (URL). Normally this path is hard-coded in the JavaScript file and is relative to the location from where the JavaScript is called, but you can set the variable g_GameMakerHTML5Dir before the call to the game script and the game will be run from the newly defined location. For example:

<script>var g_GameMakerHTML5Dir = "http://mygamealternatedirectory.com/";</script>


Back: Reference
© Copyright YoYo Games Ltd. 2018 All Rights Reserved