How to know which touch is released? Any ideas?

scitunesscitunes Member, Sous Chef Posts: 4,047
edited December 2011 in Working with GS (Mac)
So lets say you have 5 touch actors like the ones in the official GS joystick demo. You put all five fingers on the screen in any random order and leave all 5 there. So now the five touch actors change their location to your finger tips in whatever order your fingers happened to touch the screen. Now you lift one of your fingers off the screen. How can I get my game to know which finger was released?

I've tried adding "when touch is released" to the touch actors but it only works if after I remove my finger I quickly tap the touch actor again. I need to know which finger is released immediately after it is lifted off the screen.

Any ideas?

Thanks, guys!

Comments

  • cbtcbt Member Posts: 644
    Maybe you can check every touches X and Y values every 0.1 second. When Touch4 X and Y stays the same for 0.5 second it means it is not touching anymore. And I'm about 80% sure no human can put his finger steady enough for 0.5 seconds to cheat/mistake the system.

    I don't know really if this will work or even worth it. Sounds like system-consuming.

    Just an idea :D
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    edited December 2011
    thanks for sharing the idea. I'm guessing that putting a timer like that in all 5 touch actors is going to have a noticeable drag on the game.

    Unless someone on the forums has some totally outside the box approach to this I think I will just not use multitouch. Then I can just check for mouse button up. Problem is that if you have say your right thumb on the screen unintentionally and you use your left index finger for the game, the game will not see the releasing of the left finger as mouse up because the right thumb is still down.
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    last bump and then I'll assume it can't be done.

    thanks
  • calvin9403calvin9403 Member Posts: 3,186
    @sc

    how about making an actor when touch is press than constrain that to the touch X and Y?

    Calvin
Sign In or Register to comment.