Calculate touch drag distance before releasing?
![jonnyDiamond](http://forums.gamesalad.com/applications/dashboard/design/images/defaulticon.png)
Hi,
This is a tricky one to explain , but I will do my best.
I have an actor that I want to control its rotation with, by touch and dragging on the y axis.
I currently have it working by calculating game.touch.Y and converting it into an angle.
But my problem is that I want the drag to add to the actors rotation angle as apposed to just changing angle.
I want the touch gesture to be like a scrolling action. The more you flick upwards, the more the actor rotates. Like the difference between using a mouse to a wacom tablet(if you know what I mean?).
So, what I think I need to do is to continually measure the distance of the drag from the first game.touch.Y to where ever the game.touch.Y moves too (not released) - then convert this distance to an angle - then use that to add to the actors angle.
It is important that it adds to the actors angle (accumulative) as apposed to just changing it.
Also, it is important that I constantly measure the distance - So not just on release.
Any ideas?
Thanks for your help.
This is a tricky one to explain , but I will do my best.
I have an actor that I want to control its rotation with, by touch and dragging on the y axis.
I currently have it working by calculating game.touch.Y and converting it into an angle.
But my problem is that I want the drag to add to the actors rotation angle as apposed to just changing angle.
I want the touch gesture to be like a scrolling action. The more you flick upwards, the more the actor rotates. Like the difference between using a mouse to a wacom tablet(if you know what I mean?).
So, what I think I need to do is to continually measure the distance of the drag from the first game.touch.Y to where ever the game.touch.Y moves too (not released) - then convert this distance to an angle - then use that to add to the actors angle.
It is important that it adds to the actors angle (accumulative) as apposed to just changing it.
Also, it is important that I constantly measure the distance - So not just on release.
Any ideas?
Thanks for your help.
Comments