Transparent color of sprite in 3d mode???

Blitz3D Forums/Blitz3D Beginners Area/Transparent color of sprite in 3d mode???

Anatoly(Posted 2005) [#1]
Is black the only transparrent color I can use to texutre a sprite in 3d?
I'm so used to using "ugly magenta" (255, 0, 255) for transparrency in 2d games! ;-)
Is there any way to mask a texture/brush color?


PowerPC603(Posted 2005) [#2]
It appears so (check the TextureFilter command in the docs).

It says that TextureFilter 4 enables masking of your texture, but only for black.

Unless you use a png-texture (png files can include the alpha channel, IIRC).
Then you could use TextureFilter 2, this enables the alpha channel for your texture.

Or just include flag 2 into your LoadTexture command:
LoadTexture("MyTexture.png", 1+2) ' flag 1 is default


Anatoly(Posted 2005) [#3]
Wow! So I can just use a transparent color in png file and then load it up in Blitz and it will work?!?!? 8-0
Thanks, dude!


Ross C(Posted 2005) [#4]
You could use the function i have written:

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

It will basically use the colour you specify as a mask colour for a sprite.


Anatoly(Posted 2005) [#5]
I've tried pngs and it worked fine - thanx guys!