Allow user to draw a line renders sprite

Get help using Construct 2

Post » Fri Jan 04, 2013 4:10 pm

Ok so I want to allow a user to essentially draw a line but when their mouse is released the line is replaced with a sprite (or a series of). For example a pipe using a repeating (seamless) PNG so it looks normal and not stretched or anything

Is this kind of thing possible in Scirra?
B
7
S
1
G
1
Posts: 25
Reputation: 701

Post » Fri Jan 04, 2013 4:16 pm

As long as there is no vertical texture then a sprite will work.
Just set the hotspot to 4 or 6(one side of the image or the other).

Otherwise you can use the tiled bg object if you have a repeatable texture.
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Fri Jan 04, 2013 4:19 pm

Thanks Newt I forgot to add that the line will not be straight it would an 'S' shape for example.
B
7
S
1
G
1
Posts: 25
Reputation: 701

Post » Fri Jan 04, 2013 4:28 pm

We don't have access to distort maps... yet, so using one object isn't really doable.
You could set up an array with all the xy positions of a series of sprites, or use the Canvas plug and use some of its path functions.
Course there wouldn't be any texture using Rojo's canvas.
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Fri Jan 04, 2013 4:29 pm

ok thanks
B
7
S
1
G
1
Posts: 25
Reputation: 701


Return to How do I....?

Who is online

Users browsing this forum: Televangelist and 22 guests