How to completely disable multitouch

Get help using Construct 2

Post » Sat Sep 07, 2013 5:28 pm

My project is almost finished, so this is one of the last issues I have.

What is the most elegant and simple way, with the least amount of code and hopefully something that could be externally (externally as in, without adding new variables, switches, stuff in the already present code) implemented without meddling with the code that is already present?

Or if it couldn't be done, with the minimal amount of change to already present code.


Thank you for your replies folks, this is probably the last great conundrum I have for this project.

EDIT: Oh and I use CocoonJS + full Construct 2 + it's an iOS project onlydamjancd2013-09-07 17:29:23
B
37
S
6
G
1
Posts: 301
Reputation: 2,865

Post » Sat Sep 07, 2013 5:45 pm


On ANY multitouch event
compare two values(touch.index = 0)

On Touch Start
touch.index = 0

on Touch.End
touch.inde = 0

Is in Touch
touch.index = 0

Is Touching object
touch.index = 0

this shuold always evaluate to the touch object of 0.

This however has one draw back and I don't see away around it.
1. Touch to screen. This is index 0 which we will name A
2. Touch another finger to screen. This is index 1. with say name B
3. Untouch finger A. Finger B now becomes index 0

that as what I can figure the best alternative. There is no simple option to just disable Multi touch in the properties. If you want a true single touch experience and avoid the index shifting in above example. You will need then need to be a little more advance be associating a Touch.index with a Touch.ID. but then your getting into more work.
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,028

Post » Sat Sep 07, 2013 7:13 pm

@Jayderyu Thank you a whole bunch of kittens. I will implement this and maybe try to work around the drawback. I can code complex stuff, I just don't want to brake anything that I've already built, so I'm keeping away from longer lines :) I've gone through hell fixing 1 thing, and braking 10.

Another user asked a similar question, I will post your answer to him too, soured of course :)
B
37
S
6
G
1
Posts: 301
Reputation: 2,865

Post » Sat Sep 07, 2013 10:58 pm

It's not really working, or I'm an idiot in implementation. How can I declare "On ANY multitouch event"?
nTh instance touch and then select with an or block 1 2 3 4?

Is this a variable? "touch.index", and if not, how do I set touch.index to 0 via an action?

Struggling to get this, sorry :)
B
37
S
6
G
1
Posts: 301
Reputation: 2,865

Post » Tue Sep 10, 2013 6:31 pm

I dived into the code and just added HAS TOUCH 0 and on start and end of n-th touch where appropriate. It worked fine :)

B
37
S
6
G
1
Posts: 301
Reputation: 2,865


Return to How do I....?

Who is online

Users browsing this forum: Wink and 38 guests