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?
disabled staticimage and statictext
Moderators: CEGUI MVP, CEGUI Team
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
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:
Hope it gives you some ideas. We'll have to consider adding the missing states for this
CE.
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.
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.
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.
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
-
- Just popping in
- Posts: 3
- Joined: Wed Aug 13, 2008 04:30
- Contact:
Re: disabled staticimage and statictext
One workaround you could try is to change the alpha of the staticimage /statictext when it is disabled.
Who is online
Users browsing this forum: No registered users and 18 guests