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.
Guest
Post
by Guest » Mon Feb 27, 2006 4:22 pm
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 » Mon Feb 27, 2006 6:00 pm
Process to answer this question for yourself...
What is the type of env in the code above?
Look at the documentation for that type.
What is the return type of the method addStaticText ?
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.
See anything useful?
Guest
Post
by Guest » Tue Feb 28, 2006 11:58 am
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 » Tue Feb 28, 2006 11:58 am
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 » Tue Feb 28, 2006 1:58 pm
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 » Thu Jun 29, 2006 6:10 am
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