Z
zendraw
Guest
i want to draw a surface over a sprite in a way that the sprite`s alphas are applied to the surface so the surface is like cut based on the sprite. i have some code from before that doesnt work now for some reason.
GML:
draw_self();
if (surface_exists(surf))
{
draw_surface_ext(surf,
x,//+lengthdir_x(coordx, coorddir+image_angle),
y,//+lengthdir_y(coordx, coorddir+image_angle),
1, 1, image_angle, -1, 1);
} else
{
gpu_set_colorwriteenable(true, true, true, false);
surf=surface_create(320, 320);
surface_set_target(surf);
draw_clear_alpha(c_black, 0);
draw_sprite(surface, 0, coordx, coordy);
surface_reset_target();
gpu_set_colorwriteenable(true, true, true, true);
}