Connecting instances with lines

Get help using Construct 2

Post » Sun Feb 03, 2013 3:18 am

ConnectNodes.capx

I have a bunch of nodes on a layout, and I would like to connect each with a line to all the other nodes
But for the moment they all converge to a single node for some reason
Having hard times figuring out the right "picking" setup I guess...

Any tips appreciated
Thxlemo2013-02-19 06:16:08
B
20
S
5
G
8
Posts: 325
Reputation: 6,473

Post » Sun Feb 03, 2013 6:46 am

This was a challenge!

ConnectNodes_answer.capx
ImageImageImage
B
67
S
19
G
123
Posts: 3,209
Reputation: 73,905

Post » Sun Feb 03, 2013 7:49 am

@blackhornet
Thanks, works great!

Now I have a new challenge if you like ;)
You may have seen that the nodes had a drag and drop behavior
Ideally I would like the lines to follow while dragging any nodes if doablelemo2013-02-03 07:50:32
B
20
S
5
G
8
Posts: 325
Reputation: 6,473

Post » Sun Feb 03, 2013 2:30 pm

Okay I figured out how to add it to your code
Just wanted to make sure everything was redrawn only while dragging, otherwise the framerate was going nuts
Also I added a minimal distance check and a right-click to add nodes ^^

ConnectNodesDrag.capx

I'm leaving the challenge open though if someone manage to do all this with less events!lemo2013-02-19 06:17:15
B
20
S
5
G
8
Posts: 325
Reputation: 6,473

Post » Sun Feb 03, 2013 4:42 pm

I was testing random stuff
So here is a happy rainbow kinda thingie!


HappyRainbow.capx

Actually the rainbow is animated and flows to the right nicely
This uses the Tiled Sprite plugin @SirG
I'm not sure I'll use this for my project because the fps are dropping fast with many nodes, but it could be super handy to create all kind of moving things, escalators, hydraulic pipes, tank tracks, conveyor belts...lemo2013-02-19 06:18:02
B
20
S
5
G
8
Posts: 325
Reputation: 6,473

Post » Wed Jul 20, 2016 3:21 pm

lemo wrote:I was testing random stuff
So here is a happy rainbow kinda thingie!


HappyRainbow.capx

Actually the rainbow is animated and flows to the right nicely
This uses the Tiled Sprite plugin @SirG
I'm not sure I'll use this for my project because the fps are dropping fast with many nodes, but it could be super handy to create all kind of moving things, escalators, hydraulic pipes, tank tracks, conveyor belts...lemo2013-02-19 06:18:02


@SirG Plugin is located here... plugin-tiled-sprite_t70501 , I really hate dead links. ;)
B
29
S
13
G
10
Posts: 355
Reputation: 8,297

Post » Thu Jul 21, 2016 11:29 am

@Carbincopy there is working link to dropbox in last message :)
ImageImage
B
68
S
23
G
7
Posts: 186
Reputation: 9,786


Return to How do I....?

Who is online

Users browsing this forum: Televangelist and 26 guests