How do I make gesture rotation on mobile

Get help using Construct 2

Post » Thu Feb 19, 2015 2:51 pm

I'm currently developing a tangram game and I'm trying to make rotation on each puzzle piece with gesture detection on screen (touch / mobile).

At this stage, I see 2 different possibilities to do it :
1. one active piece is selected and the rotation of the piece depends on the rotation gesture speed around the piece
2. piece is selected with one finger and the second finger make a rotation around the piece for the rotation degree.

I had a look on this 2 plugins : plugin-multi-touch_t67519
but I don't think it can help a lot...

Any ideas on how I can do this ?

Many thanks for your help,
Posts: 5
Reputation: 210

Post » Tue Feb 24, 2015 2:42 pm

Hi guys,
these is where I'm with my issue.
I've used the angle(x1, y1, x2, y2) / atan function to generate the rotation angle depending on x,y coordinates of the touch action around the piece.

Unfortunately, controls are still impossible to use on mobile, it jumps from one angle to another without distinctions.
I've attached my current test...

Any ideas of the kind of math function I can use ?
I guess there is probably a solution with cosinus using 3 points : x,y and image point - but I don't know how to build it...

Many thanks for you through !
You do not have the required permissions to view the files attached to this post.
Posts: 5
Reputation: 210

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 7 guests