Andymakeer
Member
Hey guys!
So I was playing with surfaces and blend_modes and found out its possible to customize the blending results.
I was trying to draw text to an alpha-cleared surface, but the result was kinda ugly.
Then, after studying a little, i was able to "ignore" the surface color and alpha blend and draw using only the text color and alpha.
But i encountered another problem:
When a text in drawn above another, then the overlapping parts turn all black!
Here is my code:
Help
So I was playing with surfaces and blend_modes and found out its possible to customize the blending results.
I was trying to draw text to an alpha-cleared surface, but the result was kinda ugly.
Then, after studying a little, i was able to "ignore" the surface color and alpha blend and draw using only the text color and alpha.
But i encountered another problem:
When a text in drawn above another, then the overlapping parts turn all black!
Here is my code:
GML:
surface_set_target(global.surface_hud);
draw_set_font(text_font);
draw_set_color(image_blend);
draw_set_alpha(1);
gpu_set_blendmode_ext_sepalpha(bm_src_color, bm_zero, bm_one, bm_one);
draw_text(x, y, text);
gpu_set_blendmode(bm_normal);
surface_reset_target();