An Always Interconnected Line

Get help using Construct 2

Post » Mon Nov 26, 2012 7:43 pm

I don't know if this is going to have an easy answer, but it's worth a try..

Would it be possible to have a line (preferably a curve, but a straight line would be fine) connected to two separate objects and have it's width/ angle automatically change while one or both of the objects were moving?

The best example I found was this js test - . You can drag around the markers and see how the arcs still remain no matter what the distance, and the movement is smooth.

I'm thinking the canvas plugin would be used to create the curves, but not sure as far as motion goes...

Any help would be greatly appreciated
Posts: 45
Reputation: 4,502

Post » Mon Nov 26, 2012 8:56 pm

For a line add a sprite and make it's origin to it's left/center.

To make the line between two objects:
1. set the line's position to the first object.
2. set the line's angle toward the second object.
3. set the line's width to the distance between the two objects.

And yes you can use the canvas plugin to draw a curve (a line as well if you want).
made with r110.2

The canvas plugin wraps much of the html5 canvas so you can use javascript examples as a guide. 21:51:13
Posts: 4,671
Reputation: 37,207

Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, db3344, makkancs, matriax, newt, orugari, Saad Swad, Taweel and 18 guests