Un-MaskImage?

Blitz3D Forums/Blitz3D Beginners Area/Un-MaskImage?

_PJ_(Posted 2009) [#1]
Using 2D images and MaskImage, Even if i apply MaskImage to magenta (255,0,255) because black is a 'colour' I want visible, I find that the black (0,0,0) is still transparaent. (Admittedly, so is the magenta).

Does MaskImage accumulate? How can I turn off MaskImage for a particular colour?

It's not a big issue with respect to my particular situation as I just made the black a kind of darker grey, but it seems stsrange nonetheless.


Warner(Posted 2009) [#2]
MaskImage should not work acummulative. After loading an image, you should be able to change the transparent color with it.
im = loadimage("test.bmp")
maskimage im, 255, 0, 255
cls
drawimage im, 0, 0
flip

If you want to draw images without transparency, use DrawBlock instead of DrawImage.


_PJ_(Posted 2009) [#3]
Ahhh!

I'm glad you mentioned the "DrawBlock"

Sorry, I see what I've done now. I had masked an overall spritesheet, but to save space on the size of the spritesheet, I was coding in mirrored versions for say walking left instead of right etc.
In copying the images over, I had neglected to set the mask of the NEW copy, so whilst the copied image had the magenta removed (turned to black thanks to correct masking) the copy now continued with the default Black mask!

Doh !

*Must remember to look at code more carefully before posting* ;)