Discord
Login
Community
DARK THEME

Is there a way to know if we run inside browser, mobile or standalone versions ?

We have the quit function but i only like to display "Quit" in my main menu for certain "builds". For example i do not want it displayed when the game is running inside a browser / html page, however i do want it displayed when the game is running as a standalone linux / mac / windows app and potentially android apk.

Is there a way to detect this or does the build systems set a specific flag so we can identify where we are running from ?

I have a similar question for Mobile / non mobile detection. Suppose i create some virtual controls for android version i need to be able to detect this to only show it on android version or in browser if it is detected that the browser is ran on a phone or so

You can do this from within the javascript code. Here's an example.

https://microstudio.io/i/Loginus/detectos/

There are also libraries that detect the screen size and determine whether the view is horizontal or vertical. Few people have a vertically positioned monitor, so this can also be used for detection.

thanks that should help

Post a reply

Progress

Status

Preview
Cancel
Post
Validate your e-mail address to participate in the community