How to detect mobile device?

Discussion and feedback on Construct 2

Post » Fri Nov 11, 2016 3:53 am

I want to know how to detect mobile device?I found a post about this,it said that I can use the function 'Is On Mobile Device' in the object Browser.But I can't see this condition in Browser.Anyone can help me?Thank you so much.
B
9
S
2
Posts: 13
Reputation: 551

Post » Fri Nov 11, 2016 9:28 am

You should take a look at the Browser object's platform expression:
https://www.scirra.com/manual/110/browser
B
129
S
33
G
17
Posts: 1,552
Reputation: 20,515

Post » Sat Nov 12, 2016 7:17 pm

Code: Select all
who told you
the expression is on browser object?
(rephrased : what post told you that @KKdenis ?)


the expression "Is on mobile device" or "is on platform " and u select the platform from the dropdown menu its found in the System expression list.



yes the "is on mobile" can be detected by using the browser object however its not required unless u need a specific mobile device to be detected, for example u want to lock ur game to be played only on ipad4 or samsung galaxy S what ever... but i doubt u want that.

care to mention that the browser object has mobile expression such as detecting if the mobile button back or the arrow that is inscriptioned on the devices as an arrow ( < >), same applies to menu buttons and others that can be found on most smartphones(outside iPhone which has only 1 button i think.)


i suggest either read the manual, or if that makes u confused, go trough the entire example files C2 comes with... you will learn faster that way the basics.
Last edited by gamecorpstudio on Sun Nov 13, 2016 4:15 pm, edited 3 times in total.
B
70
S
20
G
67
Posts: 1,316
Reputation: 42,305

Post » Sun Nov 13, 2016 11:10 am

@gamecorpstudio Yes, you are right. The browser object's platform expression returns the OS it's running on. My mistake.
B
129
S
33
G
17
Posts: 1,552
Reputation: 20,515

Post » Sun Nov 13, 2016 4:13 pm

glerikud wrote:@gamecorpstudio Yes, you are right. The browser object's platform expression returns the OS it's running on. My mistake.



oh no, i was asking the OP not you dear friend, but i was thinking someone told him that, then read it again, and i see the confusion, however the question i did, sounded a bit high-demanding sorry for that. :cry: you where right also though.
B
70
S
20
G
67
Posts: 1,316
Reputation: 42,305


Return to Construct 2 General

Who is online

Users browsing this forum: rovacado and 3 guests