Game Development Community

Transparency

by Steven Moore · in Torque X 2D · 08/10/2008 (2:32 pm) · 6 replies

Exactly what do I need to set to make BMP file transparent? I have two layers created with the first one being the primary level and the second one containing a background to show through on tiles. Exactly what do I need to do in TGB to allow this or what do I need to do to my images to allow transparency to work.

#1
08/11/2008 (8:40 am)
Personally, rather than using a BMP, I'd use a PNG with an alpha layer.
#2
08/11/2008 (5:07 pm)
That was my final solution. I used Tile Studio to load the tilemap and set the transparency color to 140. This was the default color used by the Jazz Jackrabbit tilemap I was using. I then saved it as a PNG file and the transparency was proper.

I also used Reiner's Tilecutter to save out all the tiles individually to avoid the bleeding caused by what I'm guessing is some kind of smooth filtering being introduced by default. Do you know if there's any way to avoid that? It's causing unusual lines and bleed colors to occur if I use the full tilemap and address the tiles by index (frame). It's annoying to have to deal with 256 individual tiles for the level.
#3
08/11/2008 (7:18 pm)
Just closing the loop... BMP files do not have an alpha channel, so they can not be transparent or translucent. The only (really hard way) to do this is to create a separate grayscale Alpha mask image file (black&white) and then play with the blending between layers. It's a whole lot easier to just create a .png file.

John K.
#4
08/11/2008 (9:52 pm)
Thanks for the additional info. I was able to ditch all my original programs and just pulled out Adobe ImageReady and was able to do everything from within that program by optimizing the image for PNG and setting a specific color to the transparency and used the slice tool to create the 32x32 tiles. Now, if I could just figure out how to use a single tilemap and avoid the bleeding textures!
#5
09/01/2008 (2:04 am)
I already use png files. However when I set the visivility level to less than 1 I cannot see the sprite as transparent in my game even if in the editor it was, and looks like changinf this value from code doesn't affect the object look.
#6
12/23/2008 (2:44 pm)
I've the same problem.

when i set the visibility level nothing changes...