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:

ConstantDescription
browser_not_a_browserGame is not being played in a browser
browser_unknownUnknown browser
browser_ieInternet Explorer
browser_firefoxMozilla Firefox
browser_chromeGoogle Chrome
browser_safariSafari
browser_operaOpera
browser_safari_mobileSafari Mobile
browser_windows_storeWindows 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