Transparent image

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

Orior
Just popping in
Just popping in
Posts: 6
Joined: Tue Dec 12, 2006 13:46

Transparent image

Postby Orior » Wed Dec 13, 2006 17:44

Hi!

I want to make an image transparent.
For example the background image for a FrameWindow (Taharez)...

How do I do that?

LennyH
Quite a regular
Quite a regular
Posts: 92
Joined: Thu Nov 30, 2006 20:50

Postby LennyH » Wed Dec 13, 2006 19:30

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.

Orior
Just popping in
Just popping in
Posts: 6
Joined: Tue Dec 12, 2006 13:46

Postby Orior » Wed Dec 13, 2006 19:41

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 :)

LennyH
Quite a regular
Quite a regular
Posts: 92
Joined: Thu Nov 30, 2006 20:50

Postby LennyH » Wed Dec 13, 2006 19:48

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.

Orior
Just popping in
Just popping in
Posts: 6
Joined: Tue Dec 12, 2006 13:46

Postby Orior » Wed Dec 13, 2006 22:10

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.

LennyH
Quite a regular
Quite a regular
Posts: 92
Joined: Thu Nov 30, 2006 20:50

Postby LennyH » Thu Dec 14, 2006 21:26

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.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 11 guests