General help

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

Neil
Just popping in
Just popping in
Posts: 16
Joined: Thu Sep 17, 2009 20:44

General help

Postby Neil » Mon Dec 21, 2009 00:10

Instead of creating millions of small threads and cluttering the forum, I'll just post all my questions here 8)

First up - how can I programmatically change the colour of the font? I have a dropdown combo box with names of colours. I'd like for the name of each colour to be coloured in with the respective colour, or at the least all the text inside that combo box being the currently selected colour.

Second up - I'd like a picture on the form which changes depending upon the selection of another dropdown box. It's a selection of factions, and the picture is going to be the logo of the currently selected faction. I've looked at static image but can't find any way to dynamically change its image. It's just a straight bmp/png I need, nothing fancy.

Thank you.

JoseMan
Just popping in
Just popping in
Posts: 15
Joined: Sun Nov 08, 2009 08:38

Re: General help

Postby JoseMan » Mon Dec 21, 2009 07:22

Hi,

the second to your 2nd question:
If I understand right, you need something, how you define the image for a window dynamic:

Code: Select all

Window* img = WindowManager::getSingleton().getWindow("Example/Window/StaticImage");
img->setProperty("Image", "set:BackgroundImage image:full_image");

BackgroundImage is the image you want to set e.g. "theImage.png".

Taken from this link.

Ciao J...

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

Re: General help

Postby CrazyEddie » Mon Dec 21, 2009 11:37

And for the first question:
Font's do not have colour (or any other property other than their size for freetype). The colour is set on the text/item, so for the combobox you need to set the colour via the (presumably) ListboxTextItem::setTextColours function - which can be done when you create them or later on if you need to change it.

In 0.7.x versions you can also use tags in the text to set colours, so the text:

Code: Select all

"[colour='FFFF0000']This is RED"
would show up as red.

CE.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 13 guests