How to load transparent Image?

Blitz3D Forums/Blitz3D Programming/How to load transparent Image?

Guy Fawkes(Posted 2012) [#1]
Hi all. Can someone please tell me how I can load an image to the screen, that's transparent?

Any help is greatly appreciated!

Thank You! :)


D4NM4N(Posted 2012) [#2]
Iirc b3d cannot handle alpha bitmaps properly except when using textures. It can handle mask colors though.

If you want to draw alpha images i reccommend using 3d a fake 2d overlay which is made up of flat 3d objects. This way you can get 2d with an alpha channel.
It is also faster to do this as some cards take a real hit when using drawimage over 3d.

I think i may have put something in the code archives years ago that does something like this....

Last edited 2012


Guy Fawkes(Posted 2012) [#3]
Can you show me a link to an example of how to do this?

Thank You! :)


D4NM4N(Posted 2012) [#4]
http://www.blitzbasic.com/codearcs/codearcs.php?code=1359

It was written years ago, but you might find it useful to improve on.


PS It is calculated to a virtual 640x480 overlay, it should not matter what res you have the video in, the "2D SCREEN" will always have these dimensions. Of course if you want bigger, just play with the numbers.

Last edited 2012


Ross C(Posted 2012) [#5]
Use sprites or quads. I've told you before that blitz can't do 2d alpha. You said to me in the OZ GUI thread you have a way. I also explained the only way is use textured quads or sprites.

Create a sprite.
Load a texture, with the alpha flag.
Apply the texture to the sprite.


wmaass(Posted 2012) [#6]
Not sure what your ultimate goal is but I was always a big fan of SpriteCandy.

http://www.x-pressive.com/SpriteCandy/


Yasha(Posted 2012) [#7]
This is why I keep babbling about that Draw3D system of Hectic's. It's a full drawing engine implemented using positioned mesh quads, so it can do this and many other things the 2D commands can't.


Rroff(Posted 2012) [#8]
Could always use fastimage.


Guy Fawkes(Posted 2012) [#9]
Both EXCELLENT ideas. I will try tomorrow! :D Thanks guys! :D