SetMaskColor ?

BlitzMax Forums/BlitzMax Beginners Area/SetMaskColor ?

Craig H. Nisbet(Posted 2007) [#1]
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.


Amon(Posted 2007) [#2]
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.


Craig H. Nisbet(Posted 2007) [#3]
Oh wow, I had no idea that's how it worked. Thanks!


Dreamora(Posted 2007) [#4]
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.


JazzieB(Posted 2007) [#5]
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.