Text above players' head: transparancy

Blitz3D Forums/Blitz3D Programming/Text above players' head: transparancy

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Function do_mask(texture,maskr=0,maskg=0,maskb=0)
	maskcol=(maskr Shl 16)+(maskg Shl 8)+maskb
	LockBuffer TextureBuffer(texture)
	For x=0 To TextureWidth(texture)-1
		For y=0 To TextureWidth(texture)-1
			pix=ReadPixelFast(x,y)
			If (pix And $FFFFFF)=maskcol WritePixelFast x,y,(pix Or $FF000000) Else WritePixelFast x,y,0
		Next
	Next
	UnlockBuffer TextureBuffer(texture)
End Function


Another alternative -
create texture, draw to it, then send it to the above function specifying the (r,g,b) value you want to be c-thru
(defaults to black 0,0,0)