How do I create a line while dragging with the mouse?

Get help using Construct 2

Post » Fri Sep 08, 2017 1:49 pm

How can I create a line while dragging with the mouse?
B
10
S
3
G
3
Posts: 22
Reputation: 2,198

Post » Fri Sep 08, 2017 2:35 pm

Hey @beguinner!

Depends. There are some ways you could do that. One of them is using the canvas plugin to draw the line. Another one would be to have a very small square sprite and set its width and angle according to the mouse position.

The .capx below shows the second method I mentioned above.

https://www.dropbox.com/s/tyvhmhfxcli12 ... .capx?dl=0

Hope it helps. Cheers!
Bruno

I like to eat, but I'm no cook. Why liking to play games would make you a game designer?
B
16
S
4
G
1
Posts: 408
Reputation: 2,297

Post » Fri Sep 08, 2017 6:00 pm

very nice, thanks. do you think it's possible to draw zigzag lines without releasing the mouse button?
B
10
S
3
G
3
Posts: 22
Reputation: 2,198

Post » Fri Sep 08, 2017 9:04 pm

Yes its possible, but there should be a way to tell when to zigzag. I wouldn't recommend that it creates a new line when you change direction (even though its possible) because of usability issues.

In the following example, you can zigzag by right-clicking, without releasing the left button. Does this work for you?

https://www.dropbox.com/s/l1so4t4lkznup ... .capx?dl=0

Cheers!
Bruno

I like to eat, but I'm no cook. Why liking to play games would make you a game designer?
B
16
S
4
G
1
Posts: 408
Reputation: 2,297

Post » Sat Sep 09, 2017 8:55 am

Hi, and if you want to draw curves lines with the feft clic :

https://www.dropbox.com/s/cmvt757hgw0fa ... .capx?dl=0
B
10
S
3
Posts: 81
Reputation: 828


Return to How do I....?

Who is online

Users browsing this forum: Laura_D, plinkie, Yahoo [Bot] and 30 guests