How do I rotate sprites by second touch

Get help using Construct 2

Post » Thu Sep 07, 2017 11:37 am

Hi,

I'm trying to rotate sprites by touching them with a second finger. The first touch can drag and drop the sprite the second one (still in touch with the first finger) can rotate it freely by moving the finger.

I took a look at several discussions on the net aswell as the example shipped with construct. But, I must admit, I don't get it. :) I think, I miss something with addressing the touches?

Can anyone help me out? Thanks!

held
B
5
S
1
Posts: 45
Reputation: 463

Post » Thu Sep 07, 2017 2:21 pm

Considering that not all devices are multitouch I would suggest you to rethink your controls
B
9
S
4
G
1
Posts: 33
Reputation: 873

Post » Fri Sep 08, 2017 9:54 am

Thanks for the hint. The game will be played on one specific screen.

held
B
5
S
1
Posts: 45
Reputation: 463

Post » Tue Sep 12, 2017 2:57 pm

bump
B
5
S
1
Posts: 45
Reputation: 463

Post » Tue Sep 12, 2017 3:08 pm

Image

Set the angle to the Nth touch. It is zero based so touch 1 = the second finger on the screen.
B
58
S
25
G
14
Posts: 784
Reputation: 13,284

Post » Tue Sep 12, 2017 3:26 pm

thanks! But it gives my syntax error. the comma between "Touch.x" and "touch.y" ?
B
5
S
1
Posts: 45
Reputation: 463

Post » Tue Sep 12, 2017 3:29 pm

Image

Image

You shouldn't have to set any commas. Just fill out each field for X&Y

And use "rotate toward position" NOT "set angle" :)
B
58
S
25
G
14
Posts: 784
Reputation: 13,284

Post » Tue Sep 12, 2017 3:32 pm

sorry, got it, but it's not working. on the second touch, the sprite flips 180 degrees and a dynamic rotation is not possible. Wheres my mistake?

Maybe, I didn't explain it correctly? It should behave like a typical rotation-gesture on a tablet. The angle should dynamically follow the second touch gesture.

Thanks for helping!
B
5
S
1
Posts: 45
Reputation: 463


Return to How do I....?

Who is online

Users browsing this forum: dop2000, Maako, Yahoo [Bot] and 6 guests