os_browser

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

Syntax:

GML Code Example

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 8 App

Example:

GML Code 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.





No Examples Submitted

Does this page need better examples? Be the first to Submit

No Edits Suggested

Is this page unclear or not descriptive enough? Suggest an edit to the page and with enough upvotes your changes will be made.

No Questions Have Been Ask

Do you have a question about this page? Ask it Here