kamiyasi
Member
I'm using a mask sprite in combination with bm_subtract to cut a hole in my surface, allowing the background to show through. The only problem is, for whatever reason, everything drawn that has a slight transparency is also showing the background through it, even when I use draw_enable_alphablend(false)
What I could use is something like the opposite of what draw_set_alpha_test(true) does.
As you can see here, the blue background is showing through everything on the surface that has a slight transparency to it, even though I'm using draw_set_alphablend(false)
Full code:
What I could use is something like the opposite of what draw_set_alpha_test(true) does.
As you can see here, the blue background is showing through everything on the surface that has a slight transparency to it, even though I'm using draw_set_alphablend(false)
Full code:
Code:
{
if ( global.paused==1 || (obj_player.life <= 0)) && ( scr_nottitle() )
{
d3d_set_lighting(false);
if !surface_exists(foresurf)
{
///rebuild surface
foresurf = surface_create(2560,1440);
surface_set_target(foresurf);
draw_clear_alpha(c_black, 1);
surface_reset_target();
}
////draw greyscale overlay
surface_set_target(foresurf);
draw_clear(c_black);
shader_set(shd_greyscale);
shader_set_uniform_f(uni_time, 0);
shader_set_uniform_f(uni_mouse_pos, 0, 0);
shader_set_uniform_f(uni_resolution, 2560, 1440);
shader_set_uniform_f(uni_greyscale_fade, (lfade / 100));
draw_enable_alphablend(false);
draw_surface_stretched(application_surface,-1,-1,view_wview[0]+1,view_hview[0]+1);
draw_enable_alphablend(true);
shader_reset();
}
if ((obj_player.life <= 0)) && ( scr_nottitle() )
{
lfade = min(lfade+(0.25*deltaspeed),100);
///game over message cutout
draw_set_blend_mode(bm_subtract);
draw_set_alpha( (lfade / 110) + 0.3 );
draw_background(bck_go1,580,604);
draw_set_alpha(1);
draw_set_blend_mode(bm_normal);
surface_reset_target();
draw_background_stretched(bck_go3,view_xview[0],view_yview[0],2560,1440);
draw_set_alpha(1);
var csc = merge_color(c_white,c_black,clamp(0, (lfade / 110) - 0.3, 0.9) );
draw_surface_ext(foresurf,view_xview[0],view_yview[0],1,1,0,csc,1);
///draw game over message
draw_set_alpha( (lfade / 110) + 0.3 );
draw_background(bck_go2,view_xview[0]+580,view_yview[0]+604);
draw_set_alpha(1);
}
}