directX 9, 2d transparent sprites

Started by
4 comments, last by corrington_j 20 years, 1 month ago
Is there a way to draw sprites partially transparent, so you can see through to previously drawn things.
Advertisement
ID3DXSprite::Draw Method
HRESULT Draw( LPDIRECT3DTEXTURE9 pTexture,
CONST RECT *pSrcRect,
CONST D3DXVECTOR3 *pCenter,
CONST D3DXVECTOR3 *pPosition,
D3DCOLOR Color
);

Color
[in] D3DCOLOR type. The color and alpha channels are modulated by this value. A value of 0xFFFFFFFF maintains the original source color and alpha data. Use the D3DCOLOR_RGBA macro to help generate this color.


The first byte is the alpha value, so 0x7FFFFFFF would be half transparent.

Stay Casual,

Ken
Drunken Hyena
Stay Casual,KenDrunken Hyena
Thanks
Hey I just read the post and wounder could you use clear spirits over a map to store terrain info
To add to Drunken Hyena''s post, you have to specify D3DXSPRITE_ALPHABLEND as a parameter to BeginDraw() before calling Draw().
quote:Original post by miket
Hey I just read the post and wounder could you use clear spirits over a map to store terrain info


Why would you want to store terrain info in a sprite? Just store it in a structure that won''t be rendered at all.

Stay Casual,

Ken
Drunken Hyena
Stay Casual,KenDrunken Hyena

This topic is closed to new replies.

Advertisement