• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Legacy GM afterimage blend mode [SOLVED]

K

kaito

Guest
i want to get whatever color is under my sprite
then add 24 to red component, 64 to green and 160 to blue
this is how it would look like
Sprite0001.png
how can i do this?

EDIT: i guess since RGBA needs to be from 0.0 to 1.0 then 24/255 to R, 64/255 to G, 160/255 to B
 
Last edited by a moderator:

YellowAfterlife

ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ
Forum Staff
Moderator
You could do without a shader entirely - use draw_set_blend_mode / gpu_set_blendmode with bm_add for additive blend, d3d_set_fog / gpu_set_fog with (true, <color>, 0, 0) to replace the sprite pixels with said color, then draw the sprite, then revert blend mode to bm_normal and fog to disabled.
 
K

kaito

Guest
@YellowAfterlife ty it works

draw_set_blend_mode(bm_add) d3d_set_fog(1,make_colour_rgb(24,64,160),0,0)
draw_sprite_ext(s_x,img,x,y,flip,1,0,-1,1)
draw_set_blend_mode(bm_normal) d3d_set_fog(0,0,0,0)
 
Top