Archived

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

ktuluorion

DirectX9 - Sprite Transparancy

Recommended Posts

Greetings citizens! I have a question for you all. Does anyone know how to make an D3DXSprite have a transparancy key? Like make black see through? Thank you for your time and help in advance, citizens! Piebert Entertainment ------------------------------------------------------------ GDSFUBY GameDev Society For UnBanning YodaTheCoda If you want to see yoda unbanned then put this in your sig ------------------------------------------------------------ DAIAGA Dave Astle is a God Association. To join, put this in your sig!

Share this post


Link to post
Share on other sites
I don''t know if it works like this in DX9, but in DX8 (the way I did it anyway) was in the Draw() function just set the last parameter (color) to D3DCOLOR_ARGB(255,255,255,255), and use the ColorKey in the D3DXCreateTextureFromFileEx() as the color (i.e D3DCOLOR_ARGB(0,255,0,255) is a great color to use as the color key). This should work (thats what did it for me). Hopefully this helps.

Share this post


Link to post
Share on other sites
Thank you, children of the revolution. Your services shall be remembered.

Piebert Entertainment
------------------------------------------------------------
GDSFUBY GameDev Society For UnBanning YodaTheCoda
If you want to see yoda unbanned then put this in your sig
------------------------------------------------------------
DAIAGA Dave Astle is a God Association. To join, put this in your sig!

Share this post


Link to post
Share on other sites
Actually, it doesn''t appear to be that CreateTextureFromFile takes that parameter in 9. Anyone else have any idea ;(



Piebert Entertainment
------------------------------------------------------------
GDSFUBY GameDev Society For UnBanning YodaTheCoda
If you want to see yoda unbanned then put this in your sig
------------------------------------------------------------
DAIAGA Dave Astle is a God Association. To join, put this in your sig!

Share this post


Link to post
Share on other sites
quote:
Original post by ktuluorion
Actually, it doesn''t appear to be that CreateTextureFromFile takes that parameter in 9. Anyone else have any idea ;(



Piebert Entertainment
------------------------------------------------------------
GDSFUBY GameDev Society For UnBanning YodaTheCoda
If you want to see yoda unbanned then put this in your sig
------------------------------------------------------------
DAIAGA Dave Astle is a God Association. To join, put this in your sig!


Thats why Programmer16 said: CreateTextureFromFileEx.
And I agree with Miksan, the updated Sprite interface lets you use much simpler code.

--
You''re Welcome,
Rick Wong
- sitting in his chair doing the most time-consuming thing..

Share this post


Link to post
Share on other sites