Detect Touch

Discussion and feedback on Construct 2

Post » Fri Nov 02, 2012 10:25 pm

I want to detect if there is a Touch screen when my game is run.

I can do this by putting a Touch object with touch only and no mouse.

However there seems to be no way to switch on Mouse support inside the Touch command later on, as I also want to support mouse, and having the Touch object react to mouse is very convenient.

Is there something I am missing?
B
41
S
11
G
4
Posts: 428
Reputation: 7,356

Post » Sat Nov 03, 2012 12:59 pm

keep a title screen so that when someone touches it, take it one layout, for mouse, another layout
B
20
S
8
G
2
Posts: 122
Reputation: 3,202

Post » Sat Nov 03, 2012 1:18 pm

Don't make separate layouts! It's much easier to have one layout that does everything.

Why is it important to know? Can't you just drop in the Touch object and use that solely?
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,478

Post » Sat Nov 03, 2012 7:22 pm

ash1221 that's what i am trying to do, but the Touch object cannot be modified from layout to layout. If i disable the mouse support then i am without mouse for the whole project
B
41
S
11
G
4
Posts: 428
Reputation: 7,356

Post » Sat Nov 03, 2012 7:24 pm

Ashley i just want to know if the device has touch, and if so the game controls will be slightly different from mouse.

but i want mouse too, without having to do touch + mouse conditions all the time
B
41
S
11
G
4
Posts: 428
Reputation: 7,356

Post » Sat Nov 03, 2012 8:40 pm

There is an event in the "System" List that checks if it's on a mobile device !

Try it out !
B
34
S
16
G
16
Posts: 2,222
Reputation: 16,564

Post » Sat Nov 03, 2012 9:58 pm

Whiteclaws what's if it's on a Windows8 Tablet or touch enabled laptop? These will become very common in 2013
B
41
S
11
G
4
Posts: 428
Reputation: 7,356

Post » Mon Nov 05, 2012 1:12 pm

You may disable mouse emulation on your touch object, check if the first action done by the player (ex. start screen) is from a tap or a click and then set a global value that activates one of your two control systems.Knifegrinder2012-11-05 13:12:28
B
11
S
3
Posts: 224
Reputation: 2,028

Post » Mon Nov 05, 2012 2:41 pm

The best solution is just disable 'Use mouse input' in the Touch object and handle mouse and touch input separately.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,478

Post » Mon Nov 05, 2012 3:24 pm

Yes I know I can do that Ashley, but it's a lot of work and I am very lazy!

I am trying to see if I can make a duplicate of the TOUCH behaviour, and use this without mouse on the first screen only!!!!
B
41
S
11
G
4
Posts: 428
Reputation: 7,356

Next

Return to Construct 2 General

Who is online

Users browsing this forum: MSNbot Media and 3 guests