2
\$\begingroup\$

I want to be able to run or not run code depending on which platform I am building for. Some code should only run for the HTML5 platform. How can I find out whether the platform being run is HTML5 inside my gamemaker events?

\$\endgroup\$

1 Answer 1

4
\$\begingroup\$

You can check what browser the game is currently being run in with the os_browser constant. If the game is not being run in a browser the constant will be browser_not_a_browser. So to check if it is being run in a browser simply do:

if os_browser != browser_not_a_browser {
     // Being run in a browser
}
\$\endgroup\$
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .