Goldoche
Member
I'm drawing a bunch of triangles on a surface at 0.7 alpha. Right now, if the triangles overlap it will create a darker value on the screen. However, I want all the shadows to be uniform in value on the screen. How would you do that?
Screenshot:
Screenshot:
Code:
if (surface_exists(other.surface))
{
surface_set_target(other.surface);
other.surface.depth = -10000;
draw_clear_alpha(c_white, 0);
draw_set_colour(c_black);
draw_set_alpha(1);
var indexValide1 = 0;
var indexValide2 = 0;
for (var index = 0; index < 4; index++)
{
if (coins[index] == true)
{
if (indexValide1 == 0)
{
indexValide1 = index;
}
else
{
indexValide2 = index;
}
}
}
draw_triangle(parX[indexValide1], parY[indexValide1], primeX[indexValide1], primeY[indexValide1], parX[indexValide2], parY[indexValide2], false);
draw_triangle(parX[indexValide2], parY[indexValide2], primeX[indexValide2], primeY[indexValide2], primeX[indexValide1], primeY[indexValide1], false);
surface_reset_target();
draw_surface_ext(other.surface, 0, 0, 1, 1, 0, c_black, 0.7);
draw_set_alpha(1);
}
else
{
other.surface = surface_create(room_width, room_height);
surface_reset_target();
}