How do I draw a dotted line?

Get help using Construct 2

Post » Tue Dec 27, 2016 4:52 am

Took a break from C2, now I'm back and seem to be blanking on something that sounds easy enough.

So, how do I draw a dotted line from point A to point B? I'm using it to indicate waypoints for an object so the dotted lines will vary in length, but obviously the scale of the dots in the line shouldn't change. I made a passable imitation using a Tiled Background object, problem is that it has no image point so it looks off-center. Not too noticeable with thin lines but gets progressively worse the thicker it gets.

Anyway, is there a way to do this?
B
50
S
23
G
17
Posts: 291
Reputation: 12,432

Post » Wed Dec 28, 2016 3:19 am

Just thinking out loud here.

I would make a sprite for the size dash line you want.

Then use set animation and create that sprite on a path using an event.

Set position "Dash" on angle or to object.

You will need to find each position for the dash to appear next and set the timing with a wait command probably.

It works in my head lol!
Banned User
B
23
S
6
G
58
Posts: 1,229
Reputation: 34,540

Post » Wed Dec 28, 2016 3:32 am

Sup with that? wrote:Took a break from C2, now I'm back and seem to be blanking on something that sounds easy enough.

So, how do I draw a dotted line from point A to point B?


im guessing you are talking not about a sprite like above,

use for"x"

from your x starting position
to target x position

for"y"
from your y starting position
to target y position
.
B
70
S
20
G
67
Posts: 1,316
Reputation: 42,305

Post » Wed Dec 28, 2016 9:42 am

Hmm, I suppose I could use a sprite and loop to draw the lines, but in that case I'm not sure how to make the lines "dynamic" if need be. For example if the line is between points A and B and point B is moving perpendicular to A, the line would need to change in length/angle.

For now I'm mitigating the off-center effect of the Tiled Background by playing around with image points, I was just wondering if there's a better way to do this.

Just to be clear I know how to draw the line, I just want the line to be dotted instead of solid.
B
50
S
23
G
17
Posts: 291
Reputation: 12,432


Return to How do I....?

Who is online

Users browsing this forum: Cha0tiXGamer, Google [Bot], ketramtu18, MaujDeveloper and 9 guests