Tsa05
Member
Hmmrm, blend mode help? I'm drawing 2 images to a surface, but it messes up. They are png files, a character face and then an alternate expression face:
They weren't drawing properly, so I've created a simplified example. Here's my complete example code (drawing event of object_0):
Note that I'm drawing the same 2 images, twice. First time, I draw them to a surface, then draw the surface. Second time, I draw them to the screen. Here's the result:
On the left, you can see a sort of fuzzy ring around the face, where the top image's transparency ought to be. On the right, the result I'm looking for.
I've reasoned out that the cause of this is the fact that the top image, when writing, is spewing its alpha value onto the surface as it draws, causing the surface to go see-through at those spots. I need it to draw like normal, where it considers the alpha of the image for drawing, but doesn't apply it to the surface.
What route might I try to get these guys lining up properly? (I'll be sitting here thinking as well; just tried a variety of blend mode combinations before realizing I'm not actually sure I'm going about it right)
They weren't drawing properly, so I've created a simplified example. Here's my complete example code (drawing event of object_0):
Code:
var sur = surface_create(352,791);
draw_clear_alpha(c_white,0);
surface_set_target(sur);
draw_sprite(sprite_0,-1,0,0);
draw_sprite(sprite_1,-1,152,39);
surface_reset_target();
draw_surface(sur,x,y);
surface_free(sur);
draw_sprite(sprite_0,-1,x+sprite_get_width(sprite_0),y);
draw_sprite(sprite_1,-1,x+sprite_get_width(sprite_0)+152,y+39);
On the left, you can see a sort of fuzzy ring around the face, where the top image's transparency ought to be. On the right, the result I'm looking for.
I've reasoned out that the cause of this is the fact that the top image, when writing, is spewing its alpha value onto the surface as it draws, causing the surface to go see-through at those spots. I need it to draw like normal, where it considers the alpha of the image for drawing, but doesn't apply it to the surface.
What route might I try to get these guys lining up properly? (I'll be sitting here thinking as well; just tried a variety of blend mode combinations before realizing I'm not actually sure I'm going about it right)