Image opacity

BlitzPlus Forums/BlitzPlus Beginners Area/Image opacity

Tritek(Posted 2008) [#1]
Hello all,

After looking through the blitzplus command list I noticed that there weren't any opacity type commands, or perhaps I missed them. However, I would like to know if it is possible to create opaque images. Thank you


Rob Farley(Posted 2008) [#2]
Images are opaque by default.

There is a maskimage function that allows a transparency colour in the image (use drawimage rather than drawblock to make use of this function).

Regarding images with alpha channel (which I assume is what you're talking about), in Blitz Plus it's not native.


Tritek(Posted 2008) [#3]
Hrm, thank you. Yes, I meant creating images that are not opaque. Can you do this in blitzmax? Thanks


xlsior(Posted 2008) [#4]
In blitzmax it's easy: set the blendmode to alphablend, en you can use the setalpha command to specify the level of opacity.

The big difference is that BlitzMax uses 2D-in-3D where the 3D video accelerator takes care of any blending and rotating. blitzplus is pure 2D, which means that you'll have to do the math for blending each individual pixel by the CPU, which is much slower... And there are no built-in functions that will do this for you.


Tritek(Posted 2008) [#5]
Yea, I downloaded the blitzMAX demo to test it out. Although I'm learning to script, I noticed that the setalpha command affects all images drawn. Is there a way to set the alpha to a specific image?


Dreamora(Posted 2008) [#6]
set it back after drawing


Tritek(Posted 2008) [#7]
Set it back?

Hrm, I was testing two squared images to try and get one to be set back. I used the flip;cls command, but my image just started flickering rather than what I wanted it to do.


Tritek(Posted 2008) [#8]
Nevermind, got it. Thanks all. Will be getting blitzmax =]