how check distance in pixels?

Get help using Construct 2

Post » Tue Jan 21, 2014 1:02 pm

What expression i must use to text object showed how many pixels is between the sprite A to sprite B ?
B
109
S
26
G
46
Posts: 1,885
Reputation: 35,166

Post » Tue Jan 21, 2014 1:14 pm

If you want the real distance in pixels:

distance(spriteA.x,spriteA.y,spriteB.x,spriteB.y)

If you just want the horizontal distance:

abs(spriteA.x-spriteB.x)

If you just want the vertical distance:

abs(spriteA.y-spriteB.y)
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Jan 21, 2014 1:17 pm

@LittleStain thanks for this many expressions with description thats help a lot
B
109
S
26
G
46
Posts: 1,885
Reputation: 35,166


Return to How do I....?

Who is online

Users browsing this forum: plinkie and 14 guests