Multi-touch How-to?
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.
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
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?
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.
Also I'm merging to your other thread since its basically the same thing only as a suggestion.
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.
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.
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?