Trying to draw a line starting from the point

Get help using Construct 2

Post » Mon Oct 17, 2011 10:54 pm

I want to draw a line, which will start from one point (ImagePoint) to the next point. I did it with setting line width with each tick, but it draws from the point in two directions and I want it only to go up. So basically I want to draw a line which will go just in one direction (upwards). How to do it?
Member of PLUS(S). Check out our games at: http://pluss.newgrounds.com/
B
8
S
1
G
1
Posts: 23
Reputation: 838

Post » Mon Oct 17, 2011 11:34 pm

Umm coming from a noob who likes math. You could use a line algorithim like ( Bresenham algorithm ) and try and implement it in construct. I will try to do so if i get it working i will post it.
B
5
G
3
Posts: 25
Reputation: 1,275

Post » Tue Oct 18, 2011 12:36 am

Check out in c2folder\examples (in your install of C2 on your HDD) there is one example called "Physics - distance joint.capx".
In this capx, the line is a sprite (just a color filled) and both sides of the sprite are "tied" to specific points.

Check it out, this should help you setup things the way you want.
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: 7,000
Reputation: 57,795

Post » Tue Oct 18, 2011 1:22 am

[QUOTE=samur] I want to draw a line, which will start from one point (ImagePoint) to the next point. I did it with setting line width with each tick, but it draws from the point in two directions and I want it only to go up. So basically I want to draw a line which will go just in one direction (upwards). How to do it?[/QUOTE]

Did you try to set the hotspot to the side of the image?
Like for width set it to 0x, or 4 on the numpad.
The if using height set it to y max, or 2 on the numpad.
Image Image
B
161
S
48
G
91
Posts: 7,358
Reputation: 67,271

Post » Tue Oct 18, 2011 6:12 pm

Thank you! Got it covered :) Just like @newt proposed I set a hot spot to one side of the image and it's working :)

@Kyatric Unfortunetly I don't have Physics - distance joint.capx example file. Probably because I have a free version?
Member of PLUS(S). Check out our games at: http://pluss.newgrounds.com/
B
8
S
1
G
1
Posts: 23
Reputation: 838

Post » Tue Oct 18, 2011 6:16 pm

@samur

You should have ALL the same examples as everyone else - even the 'Early Adopters'. The installation file is the same for everyone - just some functionality is different when you pay (more layers, events etc allowed).

What version have you got? Might want to try re-downloading the current R63 version.zenox982011-10-18 18:20:03
If your vision so exceeds your ability, then look to something closer.
Moderator
B
120
S
28
G
68
Posts: 4,850
Reputation: 48,301

Post » Tue Oct 18, 2011 6:33 pm

OK - after reinstal I have this example. I'll study it, thanks! :)
Member of PLUS(S). Check out our games at: http://pluss.newgrounds.com/
B
8
S
1
G
1
Posts: 23
Reputation: 838


Return to How do I....?

Who is online

Users browsing this forum: Renfd, supreme676 and 29 guests