How to detect mobile device

0 favourites
  • 6 posts
From the Asset Store
A futuristic device, can be used as radarscreen, optionscreen, infodisplay, research device, ...
  • Due to the issue of not being able to play sounds on mobile unless the user initiates a click I want to add a sprite on each page I need sound that says "Start Level" however I only want to show this on mobile devices and thus looking for a way to determine if the user is on a mobile device. If they are I can just set a global variable and do the rest from there.

    Help is much obliged.

  • The Browser object has a "Is On Mobile Device" condition

  • Yes just found that and was getting ready to reply - sorry about that looked for a long time and then right after I posted this I found:

    "Is on mobile device

    Tries to detect whether the current device viewing the project is a mobile (e.g. phone or tablet). It is difficult to accurately detect this so detection may not be perfect: there may be some mobile systems for which Is on mobile is not true, and (although less likely) desktop systems for which Is on mobile returns true. The condition always returns true when packaged via the PhoneGap/Intel XDK/CocoonJS containers, and always returns true for iOS, Android, Blackberry 10, Windows Phone and Tizen based devices. Beyond that Construct 2 will test a few other common mobile manufacturers. Otherwise, it will return true if the current system is not a desktop system, since there are relatively few desktop OSs; the desktop systems it checks for are Windows, Linux, OS 9, OS X, Solaris and BSD."

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • <img src="smileys/smiley20.gif" border="0" align="middle" />

  • Found this to work sometimes and sometimes not detect as the article I quoted mentioned. Was hoping it would be a bit more consistent than that.

  • Hey guy,I have same question.But I can't find the condition 'Is On Mobile Device' in Browser.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)