I'm encountering a weird issue. I'm hoping it's something simple I've overlooked, but...
//draw_blurshape( sprite, x, y, glow width, color, alpha )
var quality,surf,mx,my;
quality=10;
surf=surface_create_color_alpha(512,512,c_black,0);
mx=(sprite_get_width(argument0)+(argument3*2)+80)/2;
my=(sprite_get_height(argument0)+(argument3*2)+80)/2;
if surf!=-1{
surface_set_target(surf);
for(a=-quality;a<=quality;a+=1)
{
for(b=-quality;b<=quality;b+=1)
{
draw_sprite_color(argument0,0,mx+(a*argument3/quality),my+(b*argument3/quality)
,1,1,0,c_white,(1/(quality*8)));
}
}
surface_reset_target();
surface_save(surf,"glow.png"); //test
var s;
s=sprite_create_from_surface(surf,0,0,sprite_get_width(argument0)+(argument3*2)+80,sprite_get_height(argument0)+80+argument3*2,
1,1,mx,my);
draw_sprite_ext(s,0,argument1,argument2,1,1,0,argument4,argument5); //more test
sprite_delete(s);
draw_surface_ext(surf,argument1-(mx),argument2-(my),1,1,0,argument4,argument5);
surface_free(surf);
}For some reason, when I run the above code, draw_surface does not work. As you can see, to test some ideas I tried saving out the surface to an external file, and I also tried saving it as a sprite and drawing the sprite to the screen. Both of these test methods worked; the surface appears as intended. But draw_surface does nothing.
Any ideas what the cause may be?
Edited by banov, 03 June 2012 - 03:42 AM.











