problem with setmaskcolor

BlitzMax Forums/BlitzMax Beginners Area/problem with setmaskcolor

ford escort(Posted 2007) [#1]
in B+ and other blitz version it was possible to change the color used for masking on the fly with the use of maskimage r,g,b in bmax it seems that's no more possible without the need to make a new or modify the current image.

for exemple with a black logo on a white background, i wan't set the masked color as black to have a hollowed logo or white to have a solid logo on a transparent background.

also with the bmax limited maskimage function, if i understand clearly i have to grab the image to 'modify it'

so this involve on a fullscreen setup

backup the screen, drawing the picture on screen, setting the mask to white or black, grab back the picture, drawback the screen backup

instead of just 'setmaskcolor r,g,b'

also with old blitz it was possible to use a picture as a 'screenbuffer' for drawing functions that is no more possible in bmax ?


i'm really disapointed with some way bmax handle graphics.

or maybe i'm missing something


JazzieB(Posted 2007) [#2]
You have to use SetMaskColor BEFORE you load the image it relates to. Mask colours are only applied at the time of loading the image.


ford escort(Posted 2007) [#3]
sure it's the way it's done but for my problem i have to load the same picture two time in memory to have 2 mask, or draw-it,changing the mask color, grab-it back , that's a bit anoying for "basic masking operations"


Dreamora(Posted 2007) [#4]
how about just using the pixmap stored in the image and alter the mask color and let blitzmax reload it with the altered mask color?

but generally, using 2 images will be faster as reload means create a texture once again out of the image.

And no, this can not be avoided under opengl unless you use shader, DX is a different thing but you would need to do it manually.