• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

How do I put transparency at the end of draw_line?

Dr_Nomz

Member
Like you know how draw_line_width_color let's you choose what the color is at the beginning and ending? Can I make either of those transparent, and if so how do I do it?
 

Kahrabaa

Member
You could make your own script.
You can either draw more lines where the first line ends, draw the next one more transparent and the next one even more transparent.
Or, another way. At the tip of the draw_line you can draw a sprite pointing in the same direction as the line. The sprite should have gradual transparency drawn on it and then stretched with image_xscale.
 
P

ParodyKnaveBob

Guest
Howdy, Dr_Nomz,

When the built-in primitives (shapes, e.g., lines, rectangles, circles,) fall short of your plans, that's when you should start looking into building your own. $:^ ] Just a line that fades:
Code:
draw_primitive_begin(pr_linelist);
    draw_vertex_colour(_x1, _y1, c_mycolour, 1); // 1 being full opacity
    draw_vertex_colour(_x2, _y2, c_mycolour, 0); // 0 being full transparency
draw_primitive_end();
However, if you want a thicker "line," then you'll more likely need to use pr_trianglestrip to make a long, thin rectangle via two triangles. Have fun mathing the coordinates! $:^ P
 
Top