R
Rosieu
Guest
Hi again everyone!
Sorry to be bugging the forums (yet) again, but I have run into an issue with drawing to a surface that for the life of me I can't seem to fix, or even debug.
The idea was to create a surface to deal with simplistic lighting effects utilizing blend modes and the like, however the obj that initializes the surface (or any other object for that matter) seems to refuse to draw sprite / primitive / shape / whatever, other than the original draw_clear_alpha(). It doesn't seem to be an issue with the Boolean logic, as the draw_clear_alpha() functions regardless of which branch of the 'if' I place it under, however it simply will not draw anything else. Likewise I don't think it's an issue of depth, as the object's depth is set to -100000, and the sprites (etc) to draw were placed after the draw_clear_alpha in the code.
I'll include the code because it's (probably) some stuipid mistake on my part, but it's driving me up the wall! :O
Thanks in advance for any help everyone can give!
Sorry to be bugging the forums (yet) again, but I have run into an issue with drawing to a surface that for the life of me I can't seem to fix, or even debug.
The idea was to create a surface to deal with simplistic lighting effects utilizing blend modes and the like, however the obj that initializes the surface (or any other object for that matter) seems to refuse to draw sprite / primitive / shape / whatever, other than the original draw_clear_alpha(). It doesn't seem to be an issue with the Boolean logic, as the draw_clear_alpha() functions regardless of which branch of the 'if' I place it under, however it simply will not draw anything else. Likewise I don't think it's an issue of depth, as the object's depth is set to -100000, and the sprites (etc) to draw were placed after the draw_clear_alpha in the code.
I'll include the code because it's (probably) some stuipid mistake on my part, but it's driving me up the wall! :O
Code:
if(surface_exists(global.light_surface))
{
surface_set_target(global.light_surface);
draw_set_blend_mode(bm_normal);
draw_sprite_ext(spr_light,0,x,y-8,1,1,0,c_white,1);
draw_set_blend_mode(bm_normal);
surface_reset_target();
draw_surface(global.light_surface,view_xview[0],view_yview[0]);
}
else
{
global.light_surface = surface_create(view_wview[0],view_hview[0]);
surface_set_target(global.light_surface);
draw_set_blend_mode(bm_normal);
draw_clear_alpha(c_white,0.5);
draw_set_blend_mode(bm_normal);
surface_reset_target();
}
Thanks in advance for any help everyone can give!