Game Development Community

Semi-Transparent GUI objects

by Richard Jones · in Torque Game Engine · 02/27/2002 (7:32 am) · 3 replies

Hi,
How do you create a semi-transparent bitmap, such as the one used on the ChatHud (that says "welcome to the Torque demo app").
I've had a look at the hudfill.png file and it just seems to be a RGB(0,0,0) image. Why does this appear grey, and semi-transparent (so you can see what's behind it)? Is this information stored in the png file (a format I'm not that familiar with) or are there properties or flags in the script that control the transparency.
Note that I can create a bitmap that has fully transparent areas, I just need to know how to make a channel semi-transparent.

Any ideas?

Thanks very much..

#1
02/27/2002 (7:51 am)
Create alpha channel.
Make entire channel light grey.

Viola! Semi-transparent end product.

Personally, I prefer using Photoshop and exporting with an altered layer... so I get what I see :)
#2
02/27/2002 (8:02 am)
Richard - when you make your gui parts that have totally transparent areas, you'll notice that your alpha mask is black where the image is transparent. If you made the mask grey in those areas, then the images would be translucent in those places (varying with the grey level), not just transparent.
#3
02/27/2002 (8:11 am)
Thanks for that. I understand it now. I didn't realise that the hudfill.png was split into layers. I have PaintShop Pro and I clicked on Masks->Edit and the grey image showed up, which determins the transparency.

I'll see if I can create an alpha channel for my bitmap to use in my game. :)

Thanks again!