Black Sprite
Blitz3D Forums/Blitz3D Beginners Area/Black Sprite
| ||
I want to have a black sprite, its just a dot, Im going to want to use it for a bullet hole. The problem is though, when I load it, the black part gets edited out. Is there anyway to fix this and mask the red part and not the black dot in the middle? |
| ||
the bullet holes I use are black in the middle and white on the outside one of the sprite commands |
| ||
Thanks, after making it white outlined it just need to be entityblend 2 to work |
| ||
That or change the mask colour :o) See my code archive entries for that. |
| ||
Terry, Use a small 32 x 32 transparent png with a black mark (for your bullet hole) in the centre, as your sprite, and have the flags set to 3 when you load it. This will give you a floating black 'hole' which you can position for the bullet holes. BTW I mention png as thats what I'd use, but you could use a targa (tga). IPete2. |
| ||
Or think about to use DXT3 or DXT5 for masked or alpha sprites/testures. It does not only allow to use alpha independently from color, but also features smoothed mask outlines. Using Alpha for Bullets may be bad, and additional or multiplying blendmode may hide the sprite on white or black grounds, so masking may be the best choice IMHO. "Photoshop" or "The Gimp" as well as some other Apps can save DXT (aka DDS). |
| ||
Ross C is right, this is a classic case of changing the mask color. Use the MaskImage command and set the color to the red you want to get rid of. This fixes both problems. |
| ||
Maskimage won't work on textures i'm afraid. You'll need to loop through every pixel/texel and set it's alpha value, that what my function does, except it checks for colours too. |
| ||
You could try making it, instead of black, like RGB 1, 1, 1, because then people would think its black but you don't have to worry about masking it. Even better, An RGB value of 1, 0, 0. |
| ||
That's what i'd do :D Make sure your not using 16 bit graphics mode though :o) |
| ||
Ross C - Maskimage won't work on textures i'm afraid. wouldn't it work if you loaded it as a 2d image, masked it, then saved it with CreateTexture? |
| ||
It might, but having your texture be RGB 0,0,1 is much easier, IMO. |