Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

yoda5

transparency with sprites

This topic is 5418 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
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

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!