transparency with sprites

Started by
2 comments, last by yoda5 20 years, 3 months ago
I am having trouble getting the background on some sprites to be transparent. I have looked at some samples, but every time, the background keeps showing up. any suggestions? Thanks
Advertisement
Depends on how you are displaying the sprites. OpenGL? SDL blitting? More info is helpful.
Code all night.Sleep when your'e dead.
I am using DirectX 8 D3D. I have a simple little tiles class that places the tiles, then I have a tile that is a game character and when I place it, the background still shows. I have looked at some examples on transparent blitting, but it just hasn''t worked yet
there are 2 ways you can do this. One you can use alpha testing, which you can use with D3DXLoadTextureFromFileEx(). It has a color key parameter that you can set to teh sprites background color. The function will then turn that color into transparent black, so that when you blit it, it wont show with alpha testing (or alpha blending) enabled. The other way would be to just put the alpha component into the texture itself and then load it, turn on alpha testing and blit away.

| C++ Debug Kit :: GameDev Kit :: DirectX Tutorials :: 2D DX Engine | TripleBuffer Software |
| Plug-in Manager :: System Information Class :: D3D9 Hardware Enum | DevMaster :: FlipCode |



[edited by - ifoobar on January 15, 2004 8:37:37 AM]
[size=2]aliak.net

This topic is closed to new replies.

Advertisement