Page 1 of 1

[Solved]Alternatives to setTextColours(CEGUI::colour)

Posted: Fri Jul 18, 2008 13:48
by Littorio
In CEGUI 0.4 i was using

Code: Select all

static_text->setTextColours(colour);


Now in 0.6 i have to use

Code: Select all

static_text->setProperty("TextColours", "tl:FFFF0000 tr:FFFF0000 bl:FFFF0000 br:FFFF0000");


There is a method to use directly CEGUI::colour or CEGUI::ColourRect like in 0.4?
I need to change text colour frequently and create a string from CEGUI::colour would be a waste of cpu time

Posted: Fri Jul 18, 2008 14:45
by CrazyEddie
A few of the old Window based classes were removed completely and replaced with just a default window with a custom WindowRenderer and looknfeel specification - StaticText was one of these.

What you can do now, at least for the static text, is to obtain the WindowRenderer and set the colour directly on there - as opposed to on the Window:

Code: Select all

#include <WindowRendererSets/Falagard/FalStaticText.h>


using namespace CEGUI;

FalagardStaticText* stwr = static_cast< FalagardStaticText*>(static_text->getWindowRenderer());

if (stwr)
    stwr->setTextColours( ColourRect(colour) );


Of course using the window renderer directly in this manner requires that you have access to the appropriate include, and that you link with the CEGUIFalagardWRBase(_d).lib as appropriate.

CE.