Jump to content
  • Advertisement
Sign in to follow this  

Question reguarding direct3d

This topic is 4732 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am making a simple game and I am using id3dxsprites, and textures for 2d sprite images. My question is, is there a way for me to make any of the sprites paritally transparrent? thanks

Share this post


Link to post
Share on other sites
Advertisement
Yup. ID3DXSprite's Draw() function looks like this:
HRESULT Draw(LPDIRECT3DTEXTURE9 pTexture,
CONST RECT *pSrcRect,
CONST D3DXVECTOR3 *pCenter,
CONST D3DXVECTOR3 *pPosition,
D3DCOLOR Color
);


So for the Color parameter you can specify a non-fully-opague value for the alpha channel. So your parameter would be something like: D3DCOLOR_ARGB(x, 255, 255, 255) where "x" is some value between 0 - 255 (0 being fully transparent and 255 being fully opague).

Share this post


Link to post
Share on other sites
That didn't seem to make it transparent, it only changed the color of the sprite.
what am i doing wrong

EDIT:
nevermind i used D3DCOLOR_RGBA(255,255,255,155);
and that workd.

thanks for the help

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!