10-19-2004, 08:27 AM
i have this D3DXsprite and i want some parts to be transparent.
I tried using the colorkey and used this value:
the total picture i can alphablend so that everything is a little transparent but parts i can't do.
10-19-2004, 08:07 PM
perhaps u need a mask? sry i cant help more, been awhile since i used dx and i was never that good at it, but from what i remember greyscale masks allowed you to do blending or transparency on objects to different degrees across the image
10-20-2004, 10:29 AM
well if i load a texture i can set the colorkey to transparent so only that color is transparent. I want to do the same with a D3DXSprite.
10-21-2004, 01:26 PM
D3DXSprite merely draws a texture you've loaded as a textured quad. It sets all texels that match the given colour to have an alpha value of 0. If you're loading the texture and providing the colour key, then it should be drawing with transparency. Perhaps posting the relevant parts of your code would help.
10-21-2004, 03:53 PM
Sprite.Draw Weapon(Hero.current_weapon).Bullets, ByVal 0, DXE.MakeVector2(0.782, 0.587), DXE.MakeVector2(0, 0), ByVal 0, DXE.MakeVector2(600, 0), D3DColorARGB(0, 255, 0, 255)
the color on my picture that i want transparent = FF00FF and the code above i use
10-22-2004, 05:35 AM
i have fixed well sort of i just used an .tga picture file with alphablending and that works well.
10-24-2004, 02:33 PM
The colour given in the Draw call is not a colour key. You set the colour key when you load the texture.
10-25-2004, 01:15 AM
Then i have to use the texturefromfileEX cause now i'm using the texturefromfile standaard or am i wrong?
11-01-2004, 03:05 PM
Right, you need the Ex version to specify the colour key.