Archived

This topic is now archived and is closed to further replies.

Drastick

3DXSprite draw, can I change the opacity of the texture I'm drawing?

Recommended Posts

OK, I'm using the 3DXSprite draw with a texture (that may or may not already have transparency) but what I want to do is change the opacity of texture when it is drawn so I can make the image fade in and out. Is there a way to change the opacity of the texture or way to do what I want. -Thanks [edited by - Drastick on March 2, 2003 4:23:20 AM]

Share this post


Link to post
Share on other sites
For the last parameter of the Draw() method of D3DXPSRITE, you have a D3DCOLOR (DWORD) value. Pass an RGBA color with a lower alpha value and turn on alpha blending.

Share this post


Link to post
Share on other sites
Ok, I seems to work. So the hex value range for the opacity would be from 0xFFFFFFFF (0%) to 0x0FFFFFFF (100%) right. So how about a away to convert 0 to 1 to an opacity value in hex. Or do I need to get created and do it myself

Share this post


Link to post
Share on other sites