Page 1 of 1
Transparent image
Posted: Wed Dec 13, 2006 17:44
by Orior
Hi!
I want to make an image transparent.
For example the background image for a FrameWindow (Taharez)...
How do I do that?
Posted: Wed Dec 13, 2006 19:30
by LennyH
tga and png files support transparency. So, in your favorite image editing tool, you can set the alpha level of the area you're interested in, all the way down to 0 [clear] and up to 255 [opaque]. You can do the same with colors in cegui, which uses AARRGGBB, where AA is the alpha level from 00 to FF.
I'm not sure if you can set alpha level of an image from within, say, the looknfeel file, though. Somebody else would have to answer that, for the moment.
Posted: Wed Dec 13, 2006 19:41
by Orior
Well what i want something similair to
<Property Name="Alpha" Value="0.5" />
But i guess i could set the alpha value to "0.5" for the image part I want to use....
But that is more a hack than a solution
![Smile :)](./images/smilies/icon_smile.gif)
Posted: Wed Dec 13, 2006 19:48
by LennyH
Well, in your looknfeel file, in an imagery component section you can add
Code: Select all
<Colours topLeft="33FFFFFF" topRight="33FFFFFF" bottomLeft="33FFFFFF" bottomRight="33FFFFFF" />
As an example. 33 is the alpha value. FFFFFF is white, and should [if I understand] not blend the true color of your image into something else.
I'm not sure if it can be done in the layout file, but, really...that wouldn't make sense for it to be done there anyway.
Posted: Wed Dec 13, 2006 22:10
by Orior
Why doesn't it makes sense?
I want the background for the FrameWindow to have a certain alpha but not the border...
So it is a part of the design, and that imo should be defined in the looknfeel.
Posted: Thu Dec 14, 2006 21:26
by LennyH
Orior wrote:Why doesn't it makes sense?
I want the background for the FrameWindow to have a certain alpha but not the border...
So it is a part of the design, and that imo should be defined in the looknfeel.
The layout is different from the looknfeel. It doesn't make sense to have transparency [or color, or anything other than placement actually] in the .layout file.
I only mentioned the .layout file because you were talking about setting properties, which is where I most often see that.
As I said in that very post, of course, you can set the transparency in the looknfeel file, although i personally think initial alphas should be set in the image file.