Jump to content
  • Advertisement
Sign in to follow this  
InsaneBoarder234

D3DXSPRITE and alpha blending

This topic is 4635 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'm fairly new to Direct3D so I was hoping someone wouldn't mind helping me out :) I'm making a 2D game using Direct3D and D3DXSPRITE to do my rendering. Is it possible to alpha blend rendered objects? And if so how? What I'm trying to achieve is a fading out effect on some of the images I'm rendering by giving them an alpha value and rendering the image with this alpha value and then decrementing the alpha so eventually the image will fade out and the background will show through. Thanks!

Share this post


Link to post
Share on other sites
Advertisement
With the Sprite interface, you can pass the flag D3DXSPRITE_ALPHABLEND to the begin function of the sprite interface.

Share this post


Link to post
Share on other sites
When you pass in a color to the Draw command (pSprite->Draw()), then set the alpha value of it. You can use the D3DCOLOR_RGBA macro.

Good luck,
Chris

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!