ID3DXSprite alphablending?

Started by
4 comments, last by Vizual 21 years, 11 months ago
ID3DXSprite has done everything I wanted except alphablending. Am I able to do alphablending with it?
Advertisement

D3DXSprite does alpha blending if the texture has alpha. You can either use a file format with an alpha channel (PNG is one) or when you load the file you can specify a colour key.

Stay Casual,

Ken
Drunken Hyena
Stay Casual,KenDrunken Hyena
Look, I already use the transparency parameter so it doesn’t show black pixels which would form a black square around the ship if I don’t use it. After I do COLORKEY transparency I want the ship to be translucent at certain points in my game so I can see the tile behind it. I have no clue how to do this.

[edited by - Vizual on May 3, 2002 5:36:50 PM]
Use the DirectX Texture Tool from the SDK to make .dds files...
K, you didn''t give a lot of detail, so I started with the basics. Generally the more (significant) info you give, the better able we are to give you good answers.

If I''m reading you second post correctly, you want to alter the global transparency of the ship (and alpha fade or something) at certain times in your game. If that''s the case, the Draw method takes a color paramter and you can use that to modulate the alpha. passing 0x7FFFFFFF instead of 0xFFFFFFFF will make it 50% opaque.

If on the other hand you want parts of your ship to be semi-transparent, then you''ll need an alpha channel in your texture.

Stay Casual,

Ken
Drunken Hyena
Stay Casual,KenDrunken Hyena
Thanks man!! that does exactly what I wanted!

This topic is closed to new replies.

Advertisement