Morkinas
Member
Hello, so i need to draw line with 0.5 alpha, but I guess I can only add the fade point
so it starts with alpha=1 and fades to my set value 0.01 in this case. I need to set start and end alpha to 0.5
Draw Event
What would be best way to fix this? Thanks
so it starts with alpha=1 and fades to my set value 0.01 in this case. I need to set start and end alpha to 0.5
Draw Event
Code:
var dir = point_direction(x, y, mouse_x, mouse_y);
var d = 1800;
//Hitscan
for(var i = 0; i < d; i++)
{
var lx = x + lengthdir_x(i, dir);
var ly = y + lengthdir_y(i, dir);
var hit = (collision_line(x, y, lx, ly, wall, false, true));
if hit != noone
{
break; //stops drawing line after a collision
}
else
{
//Draw Laser
draw_set_alpha(0.01);
draw_line_width_color(x, y, lx, ly, 1, c_yellow, c_yellow)
}
}
draw_set_alpha(1);