framewindow with round corners

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

lali
Just popping in
Just popping in
Posts: 6
Joined: Mon May 26, 2008 20:48

framewindow with round corners

Postby lali » Mon May 26, 2008 21:01

I have customized WindowsLook/FrameWindow to have round corners. My frame is wide (10 pixels).

The client area fits well in the inner part of the frame (after changing the appropriate Areas in the Looknfeel definition).

The problem is that the client area is rendered on top of the frame and not beneath it so I don't get the nice rounded corners I wanted.


Is there a way to order the rendering of the frame and client?
I have tried with Layer priority in the appropriate StateImagery sections but that does not seem to do anything.
Any ideas ?

lali
Just popping in
Just popping in
Posts: 6
Joined: Mon May 26, 2008 20:48

SOLVED

Postby lali » Tue May 27, 2008 07:33

Well,

The solution was the priority setting of the layer .. but for some reason setting a value of 1 was not enough .. nor 100 ... When setting the frame layer to 100000 I got the desired result ...

Code: Select all

<StateImagery name="ActiveNoTitleWithFrame">
            <Layer priority="100000">
                <Section section="notitle_frame">
                    <Colours topLeft="FFA7C7FF" topRight="FFA7C7FF" bottomLeft="FFA7C7FF" bottomRight="FFA7C7FF" />
                </Section>
            </Layer>
            <Layer>
                <Section section="notitle_withframe_client_area" />
            </Layer>
        </StateImagery>


This probably has something to do with ...
from CEGUIFalStateImagery.cpp

Code: Select all

   void StateImagery::render(Window& srcWindow, const ColourRect* modcols, const Rect* clipper) const
    {
        float base_z;

        // render all layers defined for this state
        for(LayersList::const_iterator curr = d_layers.begin(); curr != d_layers.end(); ++curr)
        {
            // TODO: Magic number removal
            base_z = -0.0000001f * static_cast<float>((*curr).getLayerPriority());
            (*curr).render(srcWindow, base_z, modcols, clipper, d_clipToDisplay);
        }
    }

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Tue May 27, 2008 08:47

Hi, and welcome :)

This looks like it is a bug. Not quite sure how this got missed for so long :oops:

I will add this to mantis for further investigation and repair :)

CE.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Wed Jun 18, 2008 10:48

Hi,

I have investigate this, and can report the the layers actually appear to function as expected, but... If you're using a separate client area window (perhaps embedded into the FrameWindow - as per the 'auto windows' Wiki article), this will appear in front of the imagery for the parent frame window. However, by bumping the layer of the FrameWindow imagery to such a large degree you effective push the parent window imagery forwards so it appears in front of attached child windows.

For reference purposes, the above situation (with imagery 'pushed through') is potentially unreliable (basically if it works and you're happy, it's fine, but there are potential issues).

What I might suggest is to arrange things such that you use another window for the front-most imagery (basically a DefaultWindow with some imagery applied), embed this as child within the FrameWindow LookNFeel but have it set as being always on top, but then either disabled or with MousePassThroughEnabled set to True. This should give a true 'layered' look to the imagery, while being a little more robust.

CE.


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 6 guests