Transparent widgets

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

daves
Home away from home
Home away from home
Posts: 253
Joined: Thu Feb 02, 2006 20:12

Transparent widgets

Postby daves » Wed Dec 13, 2006 17:22

I'm currently using CEGUI within Ogre. By default Ogre comes with two CEGUI schemes (WindowsLook is one of them).

I will be adding my own schemes, but have not yet learned to do this, and am looking for a quick way to add transparency to some of the CEGUI windows.

For example is there a simple way to make an Editbox transparent or translucent? Can I set an alpha value for the background color?

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

Postby LennyH » Wed Dec 13, 2006 19:33

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.


I lifted my own comment from this thread that was, funnily enough, posted around the same time you posted ^_^

daves
Home away from home
Home away from home
Posts: 253
Joined: Thu Feb 02, 2006 20:12

Postby daves » Fri Dec 15, 2006 06:56

Thanks. We were able to use the SetAlpha method of the button and it worked, but it worked on both the background and the foreground text. This is not what we want since the result is that we cant make the background almost invisible and yet keep the foreground text bright and visible.

Independently we tried to set the RRGGBBAA color on the foreground text with an alpha of 1.0, but this didnt seem to work.

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

Postby LennyH » Fri Dec 15, 2006 20:11

My understanding is that alphas stack. What I mean is, if the alpha of the parent is less than 255, you'll never be able to make the children 'brighter' than that alpha [so, setting a child alpha to 255 would result in a blend that looked like the alpha of the parent].

I haven't delved this deep into effects, but, maybe you can modify the colors in the looknfeel file to set the individual imagery sections to have the proper alpha levels that you want? I am not sure how you would do this using just code, however.

daves
Home away from home
Home away from home
Posts: 253
Joined: Thu Feb 02, 2006 20:12

Postby daves » Sat Dec 16, 2006 00:21

Thanks Lenny. Ill try it.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 12 guests