directX 9, 2d transparent sprites
Is there a way to draw sprites partially transparent, so you can see through to previously drawn things.
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
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
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
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement