Drawing a line

For questions about using Classic.

Post » Fri Aug 05, 2011 3:32 pm

Hello folks! I was wondering if there is a good way to generate a line between two points. I have a character spawning a sprite at his location, and dropping a second sprite vertically until it hits the ground.

I just needed to make a white line connecting the two. My current plan was to measure the distance between the points (which would share the same X, as it dropped only vertically), and then use that to tile a white tileable background.

Better way?

Thanks for any feedback!
B
2
G
1
Posts: 3
Reputation: 456

Post » Fri Aug 05, 2011 3:45 pm

Unless you need a texture, the line object should work.
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Fri Aug 05, 2011 3:49 pm

Line object.
Action set start X, set start Y to one of your sprite hotspot.
Set end X, set end Y to the other.

Each frame, move your objects and set the values of the line again.

And if you still need the distance between the sprites you can get it using the system/math expression "Distance between points".

(Or substracting spriteB.Y by spriteA.Y)

I hope it helps.

Edit: Ninja'd...Kyatric2011-08-05 15:50:11
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,999
Reputation: 57,793

Post » Fri Aug 05, 2011 3:51 pm

I'm newish to construct, so I'm gonna feel my way through using the line tool now. Thanks! Didn't even pay attention to it on the list.Prosth2011-08-05 16:00:46
B
2
G
1
Posts: 3
Reputation: 456


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 9 guests