os_browser

This variable holds a different constant depending on the browser the game is currently being run in.

Syntax:

os_browser


Returns: Constant


Description

This variable holds one of various constant GameMaker: Studio has to tell you which browser you are currently running the game in (if any). The following constants can be returned:

Constant Description
browser_not_a_browser Game is not being played in a browser
browser_unknown Unknown browser
browser_ie Internet Explorer
browser_firefox Mozilla Firefox
browser_chrome Google Chrome
browser_safari Safari
browser_opera Opera
browser_safari_mobile Safari Mobile
browser_windows_store Windows UWP App

Example:

if os_browser == browser_not_a_browser
   {
   global.Config = 0;
   }
else
   {
   global.Config = 1;
   }

The above code checks to see if the game is running in a browser or not and sets a global variable to a value depending on the result of the check.


Back: Operating Systems
Next: os_device
© Copyright YoYo Games Ltd. 2018 All Rights Reserved