transparent sprites with .png

Blitz3D Forums/Blitz3D Beginners Area/transparent sprites with .png

DaxTraj(Posted 2004) [#1]
Blitz3D - transparent sprites with .png format

I used photoshop to create a .png and mapped my background color as the transparent one in photoshop (color#6 in the color table)

I then used LoadAnimImage and DrawImage, but I get a white background for the sprite, when it should be transparent

Any help would be appreiciated


jhocking(Posted 2004) [#2]
Using 2D graphics commands black pixels default to transparent. You can use MaskImage (I think that's the command) to change which pixels are transparent. It doesn't matter what you select as transparent in Photoshop, only what you set in code.

Using 3D graphics commands you can do alpha transparency with png images. It's a semi-complicated process in Photoshop, involving a layer with a mask.


DaxTraj(Posted 2004) [#3]
dammit, why don't they mention that in the drawimage command ?

tehy should also have a "see also: maskimage" in that case!

working now - cheers


darklordz(Posted 2004) [#4]
x = loadimage("myimage.png"):maskimage x,255,0,255

while not keyhit(1)
drawimage x
wend
end


jhocking(Posted 2004) [#5]
"dammit, why don't they mention that in the drawimage command ?"

They really should. But don't be too hard on the manual, it really is the best programming documentation I've ever seen. It's just not perfect.