SetMaskColor ?

BlitzMax Forums/BlitzMax Beginners Area/SetMaskColor ?

Hey guys,

I'm trying to learn how to use the set mask color command. I'm guessing I'm just supposed to put it in the code before I use the draw commands right? I have an image that has a mask color of 255,0,255 and I do that and it doesn't work. Is the drawing, or image system supposed to be in a special mode to mask out the image correctly?

RIght now it looks like the black is getting masked out of my images.

You should put setmaskcolor before the loadimage command.

if you need a different maskcolor for another image set the maskcolor again before the second image's Loadimage.

Oh wow, I had no idea that's how it worked. Thanks!

or you can access the pixmap of the image, set a new maskimage and it will change on the next draw. Be aware that this generates a new image -> not really realtime suited.

Or, you can dispense with mask colours altogether. Draw your images with an alpha layer on a transparent background and save as PNGs. When drawing, use SetBlend ALPHABLEND. No need to worry about mask colours, plus you can have nice anti-aliased edges as well.