Hello, I was looking into paths and had a great success with it so far. My only issue is drawing a line from the objects starting position to the left click position. I currently have this code to draw a 1 pixel-wide line for the path, but I want to set the width of the path line to around 5 pixels.
[codebox]
//Draw Event
draw_set_color(c_red);
draw_set_alpha(0.6);
draw_path(pth_define,0,0,true);//pth_define is the path name
[/codebox]
Is there any way of tweaking it so that I could achieve this? Any help is appreciated! Thank you,
Corcor 7
Path Drawing
Started by Corcor 7, Dec 20 2008 04:33 AM
4 replies to this topic
#1
Posted 20 December 2008 - 04:33 AM
#2
Posted 20 December 2008 - 05:12 AM
#3
Posted 21 December 2008 - 12:20 AM
I thought of another way to do it, but I'm not too sure how to do it, either..Would it be possible to draw a line that conforms to the shape of a path? I'm trying to have a Fire Emblem / Advance Wars style movement. Any help is appreciated!
Edited by Corcor 7, 21 December 2008 - 12:24 AM.
#4
Posted 21 December 2008 - 08:15 AM
I checked the link from Icuurd´s post above and stripped the code down to this...
it works, but if the precision is less than 8 it looks a bit odd...
Another way would be to use this
But, again, it looks a bit odd...
Don´t know if this is any help, but at least it may point you in the right direction!
var nu,i,p;
nu = path_get_number(mypath);
n = path_get_precision(mypath)*nu;
for (i = 0; i < n-1; i += 1)
{
draw_line_width(path_get_x(mypath, i/n), path_get_y(mypath, i/n), path_get_x(mypath, (i+1)/n), path_get_y(mypath, (i+1)/n),6);
}it works, but if the precision is less than 8 it looks a bit odd...
Another way would be to use this
for (i=-3; i<4; i+=1)
{
draw_path(mypath,path_get_x(mypath,0)+i,path_get_y(mypath,0)+i,false);
}But, again, it looks a bit odd...
Don´t know if this is any help, but at least it may point you in the right direction!
#5
Posted 21 December 2008 - 08:43 PM
I also have a banner tutorial that draws textured primitive using paths... You can check it out
Edited by icuurd12b42, 21 December 2008 - 08:43 PM.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











