names of characters over there heads

Blitz3D Forums/Blitz3D Beginners Area/names of characters over there heads

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.

Masked textures don't work when you use createtexture unless you put that texture through a masking function.

This is what I use - I'm sure I got it from the code archives ..

Function TEXTUREmask( texture , sr=240 , sg=0 , sb=240, st = 30 )

	TW = TextureWidth( texture )
	TH = TextureHeight( texture )
	SetBuffer TextureBuffer( texture )
	LockBuffer 
	For j = 0 To TH- 1
		For i = 0 To TW - 1
			argb = ReadPixelFast( i,j, TextureBuffer( texture ) )
			r = ( argb And $FF0000) Shr 16
			g = ( argb And $FF00 ) Shr 8  
			b = ( argb And $FF )  
			a = ( argb And $FF000000 ) Shr 24
			
			If ( r > sr-st And r < sr+st ) And  ( g > sg-st And g < sg+st ) And ( b > sb-st And b < sb+st )
				a = 0 
				r = 0
				g = 0
				b = 0
			Else
				a = 255
			EndIf
			argb = ( a Shl 24 ) Or ( r Shl 16 ) Or ( g Shl 8 ) Or b	
			WritePixelFast i , j , argb, TextureBuffer( texture )
		Next
	Next			
	UnlockBuffer
	SetBuffer BackBuffer()
		
End Function