disabled staticimage and statictext

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

Metabug
Just popping in
Just popping in
Posts: 8
Joined: Wed Apr 09, 2008 00:12

disabled staticimage and statictext

Postby Metabug » Thu Sep 11, 2008 02:20

I want to make a custom staticimage (and statictext) looknfeel that dims its content (image or text) when it's disabled.

Based on existing looknfeel, the xml should look something like this?

<section section="image or text section name">
<Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
</section>

But I don't understand which stateimagery to put this in. WithFrameImage and NoFrameImage contain image rendering during normal enabled phase. Putting anything in Disabled doesn't seems to do anything (my guess is whatever in there gets rendered underneath With/NoFrameImage?)

How do I achieve the desired effect?

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

Postby CrazyEddie » Mon Sep 15, 2008 09:00

Hi,

I've had a quick look at some docs and what have you, and can see that we seem to be missing specific options for the image rendering in the Disabled state.

You are correct that the 'workaround' would be to use the 'Enabled' and 'Disabled' states for the actual image rather than the 'With/NoFrameImage' states. You are also correct that this will then put the image behind the frame and/or background. What you could try is playing with the priority attribute of the Layer tags; setting the Layer in the Enabled/Disabled states to higher than that of the layers for the frame and background - this might work, and it might not - I've not had time to test :?

Another alternative is to just have the 'With/NoFrameImage' states empty, and include the actual image rendering section in the state with the background (meaning. "WithFrameEnabledBackground" etc)...

You'd end up with something like this:

Code: Select all

        <StateImagery name="WithFrameDisabledBackground">
            <Layer>
                <Section look="TaharezLook/StaticShared" section="background">
                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
                </Section>
            </Layer>
            <Layer priority="1">
                <Section section="image or text section name">
                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
                </Section>
            </Layer>
        </StateImagery>


Hope it gives you some ideas. We'll have to consider adding the missing states for this :)

CE.

Metabug
Just popping in
Just popping in
Posts: 8
Joined: Wed Apr 09, 2008 00:12

Postby Metabug » Tue Sep 23, 2008 21:48

Thanks for the quick reply.

I moved the image rendering into the enabled and disabled StateImagery and used the priority property like you suggested. This way I lose the ability to specify different image rendering area with and without frame, but at least I get the dimmed effect when disabled in all combinations of frame and background.

I was going to say the text in StaticText can't be dimmed, but then I realized none of the text are dimmed in all widgets. So I guess I'll switch to use graphics text labels for the big ones I need to dim.

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

Postby CrazyEddie » Sun Sep 28, 2008 13:45

Metabug wrote:I was going to say the text in StaticText can't be dimmed, but then I realized none of the text are dimmed in all widgets.


That's odd. Either we forgot to add the lines in the looknfeels, or it's some kind of bug or other.

CE.

velur_senthil
Just popping in
Just popping in
Posts: 3
Joined: Wed Aug 13, 2008 04:30
Contact:

Re: disabled staticimage and statictext

Postby velur_senthil » Wed Oct 01, 2008 19:43

One workaround you could try is to change the alpha of the staticimage /statictext when it is disabled.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 18 guests