T
TheOakNuggins
Guest
Hello! I'm trying to clip one sprite over another (which I've done thanks to a blog post on YoYo), but now I would like to be able to change the transparency of the sprite that's being clipped.
Here's the code:
Here's what it looks like now:
I should be able to adjust the transparency so that you can see through the pink some.
Here's the code:
Code:
draw_sprite_stretched(sSolid, 0, self.x, self.y, solidxScale, solidyScale); //draws sprite going to mask
gpu_set_blendenable(false)
gpu_set_colorwriteenable(false,false,false,true); //turns colors off
draw_set_alpha(0);
draw_rectangle(0,0, room_width,room_height, false); //draw a large rectangle to be drawn on
draw_set_alpha(1); //draw masking alpha
draw_sprite_stretched(sSolid, -1, self.x, self.y, solidxScale, solidyScale);
gpu_set_blendenable(true);
gpu_set_colorwriteenable(true,true,true,true); //colors back on
gpu_set_blendmode_ext(bm_dest_alpha,bm_inv_dest_alpha); //bm_inv_dest_alpha is what masks it down.
gpu_set_alphatestenable(true);
draw_sprite_ext(sPlayer,0, mouse_x,mouse_y, 1, 1, 0, c_white, .2); //draws covering mask
gpu_set_alphatestenable(false);
gpu_set_blendmode(bm_normal);
I should be able to adjust the transparency so that you can see through the pink some.
Last edited by a moderator: