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

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

Littorio
Just popping in
Just popping in
Posts: 5
Joined: Tue Jul 15, 2008 18:56
Location: Italy

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

Postby Littorio » Fri Jul 18, 2008 13:48

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
Last edited by Littorio on Sun Jul 20, 2008 12:26, edited 1 time in total.

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

Postby CrazyEddie » Fri Jul 18, 2008 14:45

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.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 8 guests