Counting touches for multi-touch

iPhoneDevForMeiPhoneDevForMe Member Posts: 362
edited November -1 in Working with GS (Mac)
I am having an issue with multi-touch! I have yet to find any guides or forum posts explaining it. I have multiple actors that you drag accross the screen using constrain behaviors. When I touch a another actor (while still touching the first) the second one moves to the location of the first.

Ive been playing with it for awhile and here is the logic ive been trying to get work (it does not!)

Rule- When actor receives touch pressed
change attribute game.touches.count to game.touches.count+1

Rule- When game.touches.count = 1
constrain self.x/y to touch1.x/y

Rule- When game.touches.count = 2
constrain self.x/y to touch2.x/y

And so on...

Rule- When actor receives touch released
change attribute game.touches.count to game.touches.count-1

How far off am I from even coming close? I just want to be able to touch 4 different actors on the screen at once and move them all at the same time in any direction.

Can anyone provide any insight? Thanks in advance!

Comments

  • iPhoneDevForMeiPhoneDevForMe Member Posts: 362
    Anyone?
  • PhoticsPhotics Member Posts: 4,172
    Did you check the shared templates part of GameSalad. CodeMonkey posted a control demo.
  • iPhoneDevForMeiPhoneDevForMe Member Posts: 362
    @photics
    I only saw the joystick control demo on there. The demo has multitouch but it's used in a diff way and so far I havnt figured out a way to make it function the way I need it to.

    Were there any other demos I might have missed? Thanks!!
  • JoeMeisterJoeMeister Member Posts: 602
    I am having the same problem. Did you ever figured it out?
  • StusAppsStusApps Member, PRO Posts: 1,352
    my understanding was that counting touches is just for the system to recognise that 2 fingers (or more) are on the screen at once, not as part of a multitouch system. You need to look at the joystick project and understand it for that, its quite complicated.

    Counting touches can be used for something like this. I used touches.count=2 for zooming out of a scene when it is zoomed in. So when touches.count=2 it moved the camera out. The user would then be dragging the camera around with one finger and by tapping the second finger down it zoomed out.

    From what I understand touch count just does this, tells the system how many fingers are down, not telling it which finger is doing which touch.
  • Rob2Rob2 Member Posts: 2,402
    no... they ARE unique entities... you can track individual touches.. idevices app demonstrates it well
  • Rob2Rob2 Member Posts: 2,402
    scratch...I see you were talking about count....DOH
Sign In or Register to comment.