ghoti
10-19-2004, 08:27 AM
Hi folks,
i have this D3DXsprite and i want some parts to be transparent.
I tried using the colorkey and used this value:
&HFFFF00FF
the total picture i can alphablend so that everything is a little transparent but parts i can't do.
SystemOfADown
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
ghoti
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.
DrunkenHyena
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.
ghoti
10-21-2004, 03:53 PM
Sprite.Begin
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)
Sprite.End
the color on my picture that i want transparent = FF00FF and the code above i use
ghoti
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.
DrunkenHyena
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.
ghoti
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?
DrunkenHyena
11-01-2004, 03:05 PM
Right, you need the Ex version to specify the colour key.