Archived

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

Ratman

Transparency: Another way?

Recommended Posts

Im using DX8 to do a 2D engine. Ive used some of the tutorials at http://www15.brinkster.com/furby100/index.htm but use Draw to (umm) draw the textures instead of using vertex''s and all that stuff. Ive gotten everythign working, except for transparancy, or rather the color that the program doesnt draw. Usually it''s magenta or something. In the tutorials the author does this by using the 1-bit alpha channel. He wrote a program that will automatically do this. I''d rather not have to do this. In my old engine (DX 6) was able to code in to always ignore the color (255,0,255). Im wondering if there is an easier way to do this here, similiar to how I did it before. Thanks for any help Ratman --------------- Ratfest.org

Share this post


Link to post
Share on other sites
You should be able to do that by using a color key (see below)

HRESULT D3DXCreateTextureFromFileExA(
LPDIRECT3DDEVICE8 pDevice,
LPCSTR pSrcFile,
UINT Width,
UINT Height,
UINT MipLevels,
DWORD Usage,
D3DFORMAT Format,
D3DPOOL Pool,
DWORD Filter,
DWORD MipFilter,
D3DCOLOR ColorKey, <<<<<<<<<<<<<<<<<<<<
D3DXIMAGE_INFO* pSrcInfo,
PALETTEENTRY* pPalette,
LPDIRECT3DTEXTURE8* ppTexture
);

Set the ColorKey to the value you want and that should work. Good luck.

Share this post


Link to post
Share on other sites