How do I find midpoint coordinates?

Get help using Construct 2

Post » Fri Nov 06, 2015 9:37 pm

hello,

i need some tip on how to find midpoint x,y between 2 multitouches... between touch 0 and touch 1.

thanx!
B
26
S
11
G
2
Posts: 669
Reputation: 5,038

Post » Fri Nov 06, 2015 9:41 pm

A midpoint is just this: (a+b)/2
So for touch it would look like this. I don't think that was the correct syntax for touch but you should get the idea.

midx = (touch(0).x+touch(1).x)/2
midy = (touch(0).y+touch(1).y)/2
B
92
S
32
G
107
Posts: 5,274
Reputation: 69,959

Post » Fri Nov 06, 2015 9:46 pm

@R0J0hound

saves the day once again... :) !!!

thanx!
B
26
S
11
G
2
Posts: 669
Reputation: 5,038


Return to How do I....?

Who is online

Users browsing this forum: David181, evillair and 59 guests