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
113
S
29
G
48
Posts: 1,882
Reputation: 36,578

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
113
S
29
G
48
Posts: 1,882
Reputation: 36,578


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 6 guests