alpha 2d image

Blitz3D Forums/Blitz3D Beginners Area/alpha 2d image

David(Posted 2004) [#1]
where are the function to draw a image 2d with alpha?


jfk EO-11110(Posted 2004) [#2]
It is slow in 2D. If you have blitz3d you better use sprites.

In 2D you need to "mix" background and image in a selfmade function

one of the faster things to mix it 50:50 is to use the SHR command. this will mix 2 pixels:

rgb1=(readpixelfast(x,y,backbuffer()) and $FEFEFE) shr 1
rgb2=(readpixelfast(x,y,imagebuffer(myimage)) and $FEFEFE) shr 1
writepixelfast x,y,rgb1+rgb2,backbuffer()