Jump to content
  • Advertisement
Sign in to follow this  
shahmirj

DirectX Opacity

This topic is 3934 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

Ok i want to make a splash screen for my program. Except i dont want to design a sprite that holds all the different frames for my opacity levels My Game is in 2D and im loading up .png files Im using Direct3D I want to just loop through the opacity for my splash screen i got this from some where but i cant understand the language http://activedeveloper.dk/weblogs/mrjs/archive/2005/09/14/1995.aspx If you can help me or post a link to another tutorial :)

Share this post


Link to post
Share on other sites
Advertisement
Are you using the Sprite object to do your 2D drawing?

If so, then when you draw your sprite, you can supply a color (System.Drawing.Color) as one of the parameters. There is an alpha component to the color (see the System.Drawing.Color.FromARGB() function), which you can set to a number from 0 (completely transparent) to 255 (completely opaque).

So, you can adjust that alpha number over time to fade-in and fade-out a sprite.

I hope that's helpful.

-Matt

Share this post


Link to post
Share on other sites
Thats for the System lib

however i just found the answer got the idea from .FromARGB() ^

Didnt realize it had it in my code all along

D3Dsprite->Draw(sprite, &part, ¢er, &position, D3DCOLOR_ARGB(255, 255, 255, 255));

^^^^The -> D3DCOLOR_ARGB(Opacity, Red, Green, Blue);

he he :)

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!