[solved] Image Window alpha not working as expected

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

Excizted
Not too shy to talk
Not too shy to talk
Posts: 21
Joined: Tue Feb 23, 2010 22:16

[solved] Image Window alpha not working as expected

Postby Excizted » Thu Jun 24, 2010 23:51

Hello,

I've used the approach to have a simple Window containing an Image, as described here:
viewtopic.php?f=10&t=4744&p=22359&hilit=simple+image#p22359

It works just fine, except I want to add transparency - the Image tones out, but it seems like theres actually some constant color behind the image - it doesn't reveal whats actually behind the window.

Could anyone point me in the right direction? :)

Thank you so much!

agamemnus
Just can't stay away
Just can't stay away
Posts: 185
Joined: Sun Mar 14, 2010 04:21

Re: Image Window alpha not working as expected

Postby agamemnus » Fri Jun 25, 2010 04:31

Just a guess, but it might be that the color you see is the actual background behind CEGUI windows.

If so, and you are using Irrlicht, read this:
viewtopic.php?f=3&t=4943

Excizted
Not too shy to talk
Not too shy to talk
Posts: 21
Joined: Tue Feb 23, 2010 22:16

Re: Image Window alpha not working as expected

Postby Excizted » Fri Jun 25, 2010 12:08

agamemnus wrote:Just a guess, but it might be that the color you see is the actual background behind CEGUI windows.

If so, and you are using Irrlicht, read this:
viewtopic.php?f=3&t=4943


Not using IrrLicht though.. Ogre..

Excizted
Not too shy to talk
Not too shy to talk
Posts: 21
Joined: Tue Feb 23, 2010 22:16

Re: Image Window alpha not working as expected

Postby Excizted » Tue Jun 29, 2010 14:55

I've tried so much now, really can't solve it!
Is there no one out there who has had the same issue?

agamemnus
Just can't stay away
Just can't stay away
Posts: 185
Joined: Sun Mar 14, 2010 04:21

Re: Image Window alpha not working as expected

Postby agamemnus » Tue Jun 29, 2010 20:08

Check cegui/src/RendererModules/Ogre/CEGUIOgreGeometryBuffer.cpp. You can see it has both "S_alphaBlendMode" and "S_colourBlendMode".

Excizted
Not too shy to talk
Not too shy to talk
Posts: 21
Joined: Tue Feb 23, 2010 22:16

Re: Image Window alpha not working as expected

Postby Excizted » Tue Jun 29, 2010 21:53

Yes, I've checked that file and seen those two, but not been able to figure out furthermore what they are used for.
They are both used in initialiseTextureStates().

Excizted
Not too shy to talk
Not too shy to talk
Posts: 21
Joined: Tue Feb 23, 2010 22:16

Re: Image Window alpha not working as expected

Postby Excizted » Tue Jun 29, 2010 22:11

I've found that you don't actually see the viewport background of the renderer.
The image just doesn't alpha at all.

Excizted
Not too shy to talk
Not too shy to talk
Posts: 21
Joined: Tue Feb 23, 2010 22:16

Re: Image Window alpha not working as expected

Postby Excizted » Tue Jun 29, 2010 22:37

Finally!
Issue resolved! :)

Added a fifth argument to the draw call:

Code: Select all

CEGUI::ColourRect(CEGUI::colour(1.f, 1.f, 1.f, this->getAlpha()))


Ending with a function like this:

Code: Select all

void ImageWindow::populateGeometryBuffer()
{
    if(d_image)
        d_image->draw(*d_geometry, CEGUI::Vector2(0, 0), d_pixelSize, 0, CEGUI::ColourRect(CEGUI::colour(1.f, 1.f, 1.f, this->getAlpha())));
}


Return to “Help”

Who is online

Users browsing this forum: Bing [Bot] and 11 guests