May 22, 2009

Alpha masks unveiled


To add an alpha mask to a sprite is actually quite simple, but the means of doing it isn't easy to find. The code is not in GM's help documentation at all: I checked. This code is...

sprite_set_alpha_from_sprite(ind,spr)


Now for actual usage, simply put the name of the sprite of the alpha mask (An example is shown above), in the second spot: "spr", put the image you want alpha masked in the first spot. Now draw the alpha masked sprite.