Alpha Mapped Sprites

Blitz3D Forums/Blitz3D Beginners Area/Alpha Mapped Sprites

Banshee(Posted 2004) [#1]
Hello,

Firstly I am new to Blitz3D so my appologies for being a dunse.

I am trying to write a fairly simple game to start with but am having difficulty with alpha mapping and sprites.

I have created an explosion animation as a series of .bmp files with a black background and I would like the explosions to fade away, the images fade gradually to black. I am using PSP7 to create my images so transparency is very difficult, particularly gradual transparency.

I have found two commands in Blitz that I would think effect the alpha of sprites, the first and most obvious (entityAlpha) seems to fail completely though (GeForce2 MX - not latest drivers as they seem a little flakey with DX9a).

The second command was EntityAutoFade, however this did not fade out the black very well.

I have made a screenshot of both fades in action:



I am loading the cells of animation as a brush with the masked parameter:

expBrush(ex)=LoadBrush("Explosion/dth"+Str(ex)+".bmp",4)



How should I go about making the explosions fade out nicely without the solid black areas please?


Banshee(Posted 2004) [#2]
Oh my god I really am a dunse ! I read my post then realised what I was doing wrong !

loadBrush("filename",2)

all sorted :)


Ross C(Posted 2004) [#3]
Heh :)


Ross C(Posted 2004) [#4]
Also, remember that transparency can be set within blitz, for your textures. I wrote a couple of functions for this.

http://www.blitzbasic.com/Community/posts.php?topic=33427


Sir Gak(Posted 2004) [#5]
Andy: If you catch your own error before anybody else, then you are not a dunse! Sometimes, as programmers, we just need to see code from a different perspective, like posting it, to get past the problem. Cheers!