How would I go about using multi-touch to move and rotate a sprite. I would like to use two fingers, 1 finger on each end of the sprite and move it around, rotating with the two touches.
Thanks in advance.
A fast, easy to use, free, and community supported 2D game engine
How would I go about using multi-touch to move and rotate a sprite. I would like to use two fingers, 1 finger on each end of the sprite and move it around, rotating with the two touches.
Thanks in advance.
An example of touch handling is located in TouchesTest and ClickAndMoveTest if you compile the cocos2d project.
Take a look at that first and hack away at those example classes.
You're going to have tons of questions after examining those classes so show what you've inferred about how touches are handled, what you believe may help you find a solution to the question and what may still be a mystery.
Post a quick snippet of code illustrating what has been attempted. Oh and use backticks to surround the code (it's the key that's shared with the tilde "~").
For me, that would be helpful so I can, hopefully, explain touches without regurgitating any info that you already understand.
I understand that code in the tests, but to rotate based on multi touch is different than anything they have there. I know that I would have to set on of the touches as the anchor point and rotate the sprite based on the other touch. Is there a simpler way of doing this? Or could I set the two touches as points themselves then move the sprite based on the two touches?
You are AMAZING. Thanks a ton!
You must log in to post.