Can't change StaticText BackgroundColours

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

erwinxu
Just popping in
Just popping in
Posts: 5
Joined: Mon Jul 07, 2008 09:59

Can't change StaticText BackgroundColours

Postby erwinxu » Thu Aug 07, 2008 09:59

Hi there:

I can't change StaticText BackgroundColours, here are the scripts in my .xml file:

<Window Type="TaharezLook/StaticText" Name="can1.1">
<Property Name="FrameEnabled" Value="False" />
<Property Name="BackgroundEnabled" Value="True" />
<Property Name="UnifiedPosition" Value="{{0.0556,0},{0.0877,0}}" />
<Property Name="UnifiedSize" Value="{{0.8889,0},{0.0877,0}}" />
<Property Name="HorzFormatting" Value="LeftAligned" />
<Property Name="InheritsAlpha" Value="False" />
<Property Name="BackgroundColours" Value="tl:FFFF0000 tr:FFFF0000 bl:FFFF0000 br:FFFF0000"/>
<Property Name="Alpha" Value="0.5" />
</Window>

Here are the codes in my program :

guiWnd= WindowManager::getSingleton().getWindow("can1.1");
guiWnd->setProperty("Text", "Hello.");
guiWnd->setProperty("BackgroundColours", "tl:FFFF0000 tr:FFFF0000 bl:FFFF0000 br:FFFF0000");

The background colour of StaticText is still black. I have searched the forum, but I can't find any useful solution....

Thanks

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

Postby CrazyEddie » Thu Aug 07, 2008 11:57

Hi,

I think the problem here is that the imagery for the TaharezLook StaticText is black, and as such when the colours are applied nothing happens (because (0 * c) always results in 0 no matter the value of c).

You could change the looknfeel so that the image used for the StaticText backdrop brush is not black to start with (this actually comes from "TaharezLook/StaticShared", and so a change would also affect StaticImage).

CE.

erwinxu
Just popping in
Just popping in
Posts: 5
Joined: Mon Jul 07, 2008 09:59

Background colour of StaticText

Postby erwinxu » Fri Aug 08, 2008 05:51

Hi Eddie:

Thanks for your reply, do you mean this (Frame disabled)? :

<StateImagery name="WithFrameDisabledBackground">
<Layer>
<Section look="TaharezLook/StaticShared" section="background" />
</Layer>
</StateImagery>

1, I can't find "WithFrameDisabledBackground" in TaharezLook.imageset. I have no idea to which image it links.
2, If I change the colour of StaticBackdrop (in TaharezLook.tga), for example, to pure white, the background would be white;
3, If I erase the StaticBackdrop block, it would be transparent, I still can't change the colour.
4, Another question about Listbox, can I change the height of a ListBox item ?

I use CEGUI in OGRE 1.4.9, thanks a lot.

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

Postby CrazyEddie » Fri Aug 08, 2008 12:16

On closer inspection we have not got this wired together properly in the looknfeel :oops:

What you need is something like this for example (TaharezLook.looknfeel, around line: 2576)

Code: Select all

<StateImagery name="WithFrameDisabledBackground">
    <Layer>
        <Section look="TaharezLook/StaticShared" section="background" />
            < ColourRectProperty name="BackgroundColours" />
        </Section>
    </Layer>
</StateImagery>


This would be in combination with changing the brush image used. For example (TaharezLook.looknfeel, around line: 2274)

Code: Select all

<Image imageset="TaharezLook" image="MultiLineEditboxSelectionBrush" />


CE.


Return to “Help”

Who is online

Users browsing this forum: Google [Bot] and 12 guests