Page 1 of 1

static text background colors

Posted: Tue Jun 05, 2007 18:24
by overlord
is it possible to have a StaticText with a background color?
i tried

<Window Type="TaharezLook/StaticImage" Name="Testing">
<Property Name="BackgroundEnabled" Value="true"/>
<Property Name="BackgroundColours" Value="tl:FFDFDFDF tr:FFDFDFDF bl:FFDFDFDF br:FFDFDFDF" />
...

but it didn't seem to do anything

Re: static text background colors

Posted: Fri Jun 08, 2007 16:04
by overlord
i also tried editing the sample demo "first window"
and added this before the return true;

CEGUI::Window * w = winMgr.createWindow("TaharezLook/StaticText", "text");

w->setPosition(UVector2(cegui_reldim(0.25f), cegui_reldim( 0.25f)));
w->setSize(UVector2(cegui_reldim(0.5f), cegui_reldim( 0.5f)));
w->setProperty("Text", "testing");
w->setProperty("BackgroundEnabled", "true");
w->setProperty("FrameEnabled", "true");
w->setProperty("BackgroundColours", "tl:FFFF0000 tr:FFFF0000 bl:FFFF0000 br:FFFF0000");
wnd->addChildWindow(w);

the window shows up, but doesn't have any coloring

any ideas?


overlord wrote:is it possible to have a StaticText with a background color?
i tried

<Window Type="TaharezLook/StaticImage" Name="Testing">
<Property Name="BackgroundEnabled" Value="true"/>
<Property Name="BackgroundColours" Value="tl:FFDFDFDF tr:FFDFDFDF bl:FFDFDFDF br:FFDFDFDF" />
...

but it didn't seem to do anything

Posted: Fri Jun 08, 2007 18:17
by Rackle
I've tried but failed.

One clue may be found within taharezlook.looknfeel:

Code: Select all

<WidgetLook name="TaharezLook/StaticShared">
  <ImagerySection name="background">
    <Image imageset="TaharezLook" image="StaticBackdrop" />
    <!--<ColourRectProperty name="BackgroundColours" />-->
    <Colours topLeft="FFFFFFFF" topRight="FFFFFFFF" ...


versus WindowsLook.looknfeel:

Code: Select all

<WidgetLook name="WindowsLook/Static">
  <StateImagery name="WithFrameEnabledBackground">
    <Layer>
      <Section look="WindowsLook/StaticShared" section="background">
        <ColourRectProperty name="BackgroundColours" />