Multi-touch How-to?

allornothingallornothing Member, PRO Posts: 126
edited November -1 in Working with GS (Mac)
This is such a complex issue for me i'm finding it hard to actually word the question. It's taken me 2 hours to write, delete, rewrite this post - i'm tearing my hair out.

Basic goal - be able to drag multiple objects around the screen at once.

Problem - using a system like CodeMonkeys Joystick Demo, means that yes, objects are draggable. However, once the touch actor and draggable object collide, you can then just tap anywhere on screen to warp that object around the stage, as the touch actor doesn't know it has been depressed when you let go of the screen. How can I make the touch actor zip off screen again when that finger is lifted, *without* taking the collided draggable object with it?

I should add that i've tried a method where the touch actors only constrain to the touch XY when 'mouse is down' but that has its own problems, in that all touch actors will snap to the most recent touch position when you tap with just one finger.

Someone please, for all that is good in the world, please help.

Comments

  • allornothingallornothing Member, PRO Posts: 126
    Its highly frustrating that while we can interact with each Touches' X & Y, we cant use each touch in a rule. For example:

    Actor Recieves Event: TOUCH 1 is pressed
    Do this
    Actor Receives Event: TOUCH 2 is pressed.
    Do that

    It would solve so, so many problems, get us better performance as wont need convoluted solutions, and overall make multitouch development much simpler. You already track the unique touches, why not let us interact with them directly in rules?
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    You can you just have to do
    when touch is pressed
    and touchcount equals 2 or 3 or 4 etc.

    you can also look at the old joystick demo and it shows a way to setup multi touch Not sure if the new one has it in there or not.
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    Add something to the touch actors rules that says when touch is release change position or something. Id have to play with it to work something out for sure.

    Also I'm merging to your other thread since its basically the same thing only as a suggestion.
  • allornothingallornothing Member, PRO Posts: 126
    Yeah I kinda thought these were separate topics - one a question (and a plea for help!) and one a suggestion for a new feature. I kinda feel no one is going to respond to this problem now.

    edit: tried your suggestion of using touch count to determine which is the active touch, but i'm getting fairly random results. Also, the joystick demo you mentioned is the same I mentioned in the original post, and isnt a suitable solution as that doesn't stop the player from tapping to move an object.
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    Edited the title to hopefully pull in some more comments for you.
    Multi
    Mutli-touch is definitely a touch one. Not completely sure what your trying to accomplish with it but I have used codemonkeys demo test for lots of different multi-touch tests so are you sure what you are trying to do is even possible with multi touch. It might help to see a video of the issue.
  • lovelostlovelost Member Posts: 7
    Isn't the issue that we can't select the touch event to constrain to if there are multiple touches and you don't know in advance which one to respond to? So if you have two actors in a scene, both of which you want to have follow the x and y of their touches independently -- like two players each moving his or her own character -- you can't predict whether player one is touches1 or touches2, because the players will hit the screen in an unpredictable order.

    What we need is to be able to do this:

    If actor receives touch event
    Then move actor to touch.position.x, touch.position.y

    This works already if you only need to follow one touch, because that will invariably (?) be Touches1. But what if you have two independently touchable actors that you want to move at the same time? No dice, because you only have access to touch events through the ordinal objects touches1, touches2, etc., and since either actor could have been touched first, you don't know at coding time which it will be.

    So expanding the above we'd probably want this:

    If actor receives touch event
    Then move actor to touch.thistouch.position.x, touch.thistouch.position.y

    Where thistouch is a special GameSalad reference identifying the specific touch that caused the rule to fire in the first place.

    Until this is resolved I'd have to consider the GS multitouch implementation pretty limited to gestures rather than enabling true independent touch controls?
Sign In or Register to comment.