quick question about text 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
Guest

quick question about text color

Post by Guest »

this is a really basic question but i could not find the answer in the API
how do i change that color of some static text? like this one:

Code: Select all

env->addStaticText(L"Difficulty:", rect<s32>(50,150,140,170), true);
thanks
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

Process to answer this question for yourself...
  1. What is the type of env in the code above?
  2. Look at the documentation for that type.
  3. What is the return type of the method addStaticText?
  4. Look at the documentation for that type. You can do that by clicking the link to the type in the API docs you found in step 3.
  5. See anything useful?
Guest

Post by Guest »

ok heres whats in the api

virtual void irr::scene::ITextSceneNode::setTextColor ( video::SColor color ) [pure virtual]

but im not sure how to call it
can you give an example please?
Guest

Post by Guest »

ok heres whats in the api

virtual void irr::scene::ITextSceneNode::setTextColor ( video::SColor color ) [pure virtual]

but im not sure how to call it
can you give an example please?
jam
Posts: 409
Joined: Fri Nov 04, 2005 3:52 am

Post by jam »

addStaticText returns a IGUIStaticText pointer create a variable to hold that pointer you then should be able to use setOverrideColor on that pointer.
hxhieu
Posts: 4
Joined: Thu Jun 29, 2006 1:26 am

Post by hxhieu »

jam wrote:addStaticText returns a IGUIStaticText pointer create a variable to hold that pointer you then should be able to use setOverrideColor on that pointer.
That helps really much :)
But if there are hundreds of statictexts will you have to manipulate hundreds of pointers ? Is there a way to change the color of a gui element thru its ID?
1st week with Irrlicht
Post Reply