setAlpha

BlitzMax Forums/BlitzMax Beginners Area/setAlpha

Craig H. Nisbet(Posted 2007) [#1]
is there some trick to using setAlpha? It seems to not respond to floating point numbers for me. It's acting like an integer.

setAlpha 0.6 'will give me 100% alpha
setAlpha 0.5 'will give me 0% alpha


I'm using this before the draw code. Is that correct? Is there a special image mode I'm supposed to be in to get proper alphas?


Craig H. Nisbet(Posted 2007) [#2]
Wait a minute, I think I need to use Alphablend mode


Amon(Posted 2007) [#3]
Yep! You need to use SetBlend(ALPHABLEND) for it to work properly.


Craig H. Nisbet(Posted 2007) [#4]
lol, thanks, gotta love that manual.


Craig H. Nisbet(Posted 2007) [#5]
Yep, that got it.


tonyg(Posted 2007) [#6]
You don't *have* to set alphablend. You can use setalpha for other blends but notice
MASKBLEND Pixels are drawn only if their alpha component is greater than .5
.