how do I mask texture only lets thru at spots I wa

Blitz3D Forums/Blitz3D Programming/how do I mask texture only lets thru at spots I wa

You must write pixel data using The WritePixel(Fast) commands and include an alpha value. I can't find any off hand stuff, but i did write a few functions for doing this. You can pull the code for extracting the ARGB and recombining it again.

http://www.blitzbasic.com/codearcs/codearcs.php?code=1013

In fact, screw it, i'll just put it here.

			RGB1=ReadPixelFast(loop,loop1,TextureBuffer(texture))
			r=(RGB1 And $FF0000)shr 16;separate out the red
			g=(RGB1 And $FF00) shr 8;green
			b=RGB1 And $FF;and blue parts of the color
			a=(RGB1 And $FF000000)Shr 24


And for combining it again...

			newrgb= (a shl 24) or (r shl 16) or (g shl 8) or b ; combine the ARGB back into one value

			WritePixelFast(loop,loop1,newrgb,TextureBuffer(texture)); write back to the texture


All taken from the functions i've given the link too. Hope that helps :)