|
| 04 Apr 2013 07:19 PM |
| Hello. I am working with GUIs but need to find out if a player is using a tablet so I change the GUIs to better suit it (Change all the mouse over buttons to double tap ones) |
|
|
| Report Abuse |
|
|
|
| 04 Apr 2013 07:24 PM |
For now I will just make it double-tap
But if anyone knows can they please tell me? It would make it so much better :P |
|
|
| Report Abuse |
|
|
|
| 04 Apr 2013 07:31 PM |
if game:GetService("UserInputService").TouchEnabled then print("Player is on touch device.") end |
|
|
| Report Abuse |
|
|
|
| 04 Apr 2013 07:32 PM |
| Thanks! That's just what I needed! |
|
|
| Report Abuse |
|
|
|
| 04 Apr 2013 07:34 PM |
Although would that work with people with touchscreen PCs?
Would it be better to use:
if not game:GetService("UserInputService").MouseEnabled then --Your player cannot afford a mouse and stuff end |
|
|
| Report Abuse |
|
|
|
| 04 Apr 2013 07:35 PM |
| I am not sure if that would work. |
|
|
| Report Abuse |
|
|
Desperian
|
  |
| Joined: 07 Feb 2012 |
| Total Posts: 3371 |
|
|
| 04 Apr 2013 07:40 PM |
| A touchscreen enabled PC can also have a mouse with it, so your idea wouldn't work. You could check that they're on a touch enabled device, but aren't mouse or keyboard enabled. Perhaps? |
|
|
| Report Abuse |
|
|
|
| 04 Apr 2013 07:50 PM |
| It works (Now people who have a mouse and touchscreen will still use mouse input in oppose to touchscreen input) |
|
|
| Report Abuse |
|
|
| |
|
|
| 04 Apr 2013 07:56 PM |
Now for a second question:
Is it actually better to do this:
if mouse then
function1 = function(stuff) --do stuff that needs mouse input end
function2 = function(stuff) --do stuff that needs mouse input end
else
function1 = function(stuff) --do stuff that needs touch input end
function2 = function(stuff) --do stuff that needs touch input end
end
Than to use the if statement within the functions?
Less typing, but is there less lag? |
|
|
| Report Abuse |
|
|
pwnedu46
|
  |
| Joined: 23 May 2009 |
| Total Posts: 7534 |
|
|
| 04 Apr 2013 08:45 PM |
| There will be no difference. |
|
|
| Report Abuse |
|
|
janthran
|
  |
| Joined: 15 May 2009 |
| Total Posts: 17429 |
|
|
| 04 Apr 2013 10:01 PM |
| Could you just like.. Have a button when people joined to choose between touch controls and mouse controls? |
|
|
| Report Abuse |
|
|
|
| 04 Apr 2013 10:17 PM |
| What if a tablet user clicks the wrong button? The GUI will be totally messed up D: |
|
|
| Report Abuse |
|
|