Texture Masking Problem

Blitz3D Forums/Blitz3D Programming/Texture Masking Problem

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.

My problem is that I’m trying to create a texture which has text printed to it in real time and the rest of the texture is completely transparent. I want to do this so that I can have text rotating above objects in a scene. These textures have to be generated inside Blitz as because the player can rename objects.

The problem is that for some reason I can’t do this, I found that using the ‘masked’ texture flag would make this work but for some reason the texture is still an opaque black square, the only difference is that the text is no longer visible either, not exactly what I wanted!

Can anybody tell me what I’m going wrong? Is there an alternative way to do the same thing using alpha channels perhaps?

Here’s my code

Graphics3D 800,600

camera = CreateCamera()
PositionEntity camera,0,0,-3.12
CameraClsMode camera,0,1

AmbientLight 255,255,255

SetBuffer BackBuffer()


fntArialB=LoadFont("Arial",28,True)
SetFont fntArialB


back = LoadImage("2.png")


Shadow = CreateSprite()
tex = CreateTexture(256,256,1)
SpriteViewMode Shadow ,2


SetBuffer(TextureBuffer(tex))
Text 0,100,"Why won't this work?"
SetBuffer BackBuffer()


brush = CreateBrush(255,255,255)
BrushTexture brush,tex
PaintEntity Shadow, brush



Repeat
	MoveEntity Shadow,0,0.001,0
	DrawBlock back,0,0
	RenderWorld
	Flip
Until KeyHit(1)