Gui, StatiText and Color..

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Astinus
Posts: 7
Joined: Sun Sep 07, 2003 8:45 pm
Location: Italy
Contact:

Gui, StatiText and Color..

Post by Astinus »

is it possible to change the color of a StaticText?
This is my code:


guienv = device->getGUIEnvironment();
IGUISkin* skin = guienv->getSkin();
IGUIFont* font = guienv->getFont("../../media/fontnwn.bmp");
if (font)
skin->setFont(font);
guienv->addStaticText(L"Test", true, rect<int>(10,10,200,30));


I Looked for a function to change the color of the static text but i didn't find.. any suggestion?
Thanks.
Ironfoot
Posts: 15
Joined: Fri Aug 22, 2003 12:30 pm
Location: Germany
Contact:

It's possible, but ...

Post by Ironfoot »

... you "simply" have to set the color of the Button-Texts, e.g.

Code: Select all

guienv = device->getGUIEnvironment(); 
IGUISkin* skin = guienv->getSkin(); 
IGUIFont* font = guienv->getFont("../../media/fontnwn.bmp"); 
if (font) 
skin->setFont(font); 
skin->setColor(gui::EGDC_BUTTON_TEXT, video::SColor(0,255,255,255)) // Sets the Button-Text Color to white...
guienv->addStaticText(L"Test", true, rect<int>(10,10,200,30));
Great Engine, Niko, keep up the good work!
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

Since 0.4 its also possible to set the color or font for every static text, more easily.
Take a look at:http://irrlicht.sourceforge.net/docu/cl ... cText.html

Just do it like this:

Code: Select all

yourText->setOverrideColor(newColor)
Astinus
Posts: 7
Joined: Sun Sep 07, 2003 8:45 pm
Location: Italy
Contact:

Post by Astinus »

Thanks :)
Post Reply