Set Sprites Alpha Color?
I was wondering how do you set the sprites alpha color in Direct3D so Direct3D knows that a certain color means transparent? Or a texture's alpha color?
[edited by - DevLiquidKnight on February 26, 2004 7:45:21 PM]
To set a colour key in a sprite, you set it when you load the texture. Read the docs for D3DXCreateTextureFromFileEx, you''ll see it has a colour key parameter.
Stay Casual,
Ken
Drunken Hyena
Stay Casual,
Ken
Drunken Hyena
Do you know where I can find out how to use that function correctly with the color-key I read about it just not sure
Say your transparent colour is Magenta (aka Magic Pink), pass 0xFFFF00FF as the colour key and it will set all of those texels to have an alpha of 0. Similarly, if your transparent colour is black, pass 0xFF000000. Note the Alpha component of the colour is always FF since you want to filter out Opaque Black.
That''s pretty much all there is to it.
Stay Casual,
Ken
Drunken Hyena
That''s pretty much all there is to it.
Stay Casual,
Ken
Drunken Hyena
You can check this out for a working (DX8) version:
http://www.drunkenhyena.com/docs/d3d_tutorial.phtml#DHColourKey
Stay Casual,
Ken
Drunken Hyena
http://www.drunkenhyena.com/docs/d3d_tutorial.phtml#DHColourKey
Stay Casual,
Ken
Drunken Hyena
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement