DirectX Opacity

Started by
1 comment, last by shahmirj 16 years, 1 month ago
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 :)
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
www.mwgames.com - my game projects websiteNimble2D Blog - Simple 2D Game Dev with VB.Net
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, ∂, &center, &position, D3DCOLOR_ARGB(255, 255, 255, 255));

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

he he :)

This topic is closed to new replies.

Advertisement