DirectX9 - Sprite Transparancy
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!
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.
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!
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!
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!
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!
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..
I use the alpha channel in the PNG file format to get my transparency... then you can even have different alpha levels for each pixel...
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement