playMaker

Author Topic: Easy way of assigning Touch IDs??[solved]  (Read 3325 times)

markinjapan

  • Full Member
  • ***
  • Posts: 103
Easy way of assigning Touch IDs??[solved]
« on: September 20, 2011, 05:27:22 PM »
I'm just about to give up, this is either really easy and I'm missing it or it's really difficult.

What I'm trying to do is to have 2 objects on screen, moving when I touch them individually. So, I have to give them an ID of 0 and then 1 (that what works anyway). And then when I release one object, I'm guessing I don't have to do anything? And then, if both are released, I have to reset both ID to 0 again. Sounds pretty simple but I just can't get it right.

Does it sound sensible to get the IDs from the Touch Count int?

So, if Touch Count equals 1, the the first ID = Touch Count - 1 = 0. Then, on Touch Count = 2, ID 2 = Touch Count - 1 = 1.

Does this sound like the right thing to do?

If not, does anyone have a good touch manager template they'd be willing to share. At this point, I'd even pay for one. Anyone?

Thanks

« Last Edit: September 22, 2011, 06:35:09 AM by markinjapan »

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: Easy way of assigning Touch IDs??
« Reply #1 on: September 20, 2011, 06:29:14 PM »
You should store the Finger ID in the Touch Event action. Then you can use that Finger ID to filter other events. IOW, I don't think you can use the Touch Count as the ID. The Finger ID is associated with a touch, not the object... Does that make sense?

markinjapan

  • Full Member
  • ***
  • Posts: 103
Re: Easy way of assigning Touch IDs??
« Reply #2 on: September 21, 2011, 09:03:52 AM »
I was kind of thinking that's how it worked so I guess there's a problem somewhere else.

The problem I have is that when I set the ID to 'NONE' and then store the Finger ID, so that every touch after that has the ID assigned to it, when I touch something else (2nd touch), that thing is not activating. Almost like it was giving the same ID to the second touch.

I'll fiddle with it tonight in a simple case scene to check that the correct IDs are given.

Thanks

markinjapan

  • Full Member
  • ***
  • Posts: 103
Re: Easy way of assigning Touch IDs??
« Reply #3 on: September 22, 2011, 06:28:21 AM »
Ok, looks like it was something else making it not work.

One important thing to remember though. The initial Touch Event has to be set to None. I had it set to 0 because I though when I stored the Finger ID from the Touch Event, it would overwrite this default number. I was wrong.

Anyway, it works, happy.

Thanks.