Transparent Texture - How To ?

Blitz3D Forums/Blitz3D Programming/Transparent Texture - How To ?

Hi all.

What I would like to achieve, is a sprite textured with a transparent texture (flag=4 ?), then write some text on a texture, so that it appears on the sprite.

I've tryed different combination with the texture flags, but no joy...

From the flag 4 description, I read:

4: Masked - all areas of a texture coloured 0,0,0 will not be drawn to the screen



So I expect to see the cube through the sprite, and the text on the sprite itself... but it does not. Instead, the sprite is full black, solid (it covers part of the cube), and no text is written on it.

What's wrong ?!?!?

Thanks in advance...
Sergio.

Graphics3D 640,480,0,2

cam = CreateCamera()
cube = CreateCube()
MoveEntity cube,0,0,6

sp = CreateSprite()
PositionEntity sp,0,1.2,3

size = 128
mode = 4
tx = CreateTexture(size,size,mode)

EntityTexture sp,tx

SetBuffer TextureBuffer(tx)
ClsColor 0,0,0
Cls

Color 255,255,255
Text size/2,size/2,"Hello World",True
SetBuffer BackBuffer()

EntityTexture sp,tx

While Not KeyDown(1)

TurnEntity cube,0,1,0

UpdateWorld()
RenderWorld()

Flip

Wend
End