Sign in to follow this  
shahmirj

DirectX Opacity

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this