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.
Van
Posts: 9 Joined: Fri Oct 29, 2004 3:31 am
Post
by Van » Wed Nov 17, 2004 2:12 am
So, I find this great feature addTextSceneNode .
The text from addTextSceneNode is persistant which means that the text stays on the screen (and in the engine) even after the endScene is called (unlike the 2D text). Now I want to DELETE the node (ITextSceneNode) but there is no way to do it..
Anyone know how?
BTW, addToDeletionQueue does not work.
Ronin
Posts: 116 Joined: Wed Mar 03, 2004 6:23 pm
Location: Germany
Post
by Ronin » Wed Nov 17, 2004 2:05 pm
I don't know what you mean by 2D Text, but a GUIStaticText also stays on screen until it is removed manually.
As the name says, A TextSceenNode is a SceneNode, you remove every SceneNode by simply calling ISceneNode::remove().
Hope, that helps.
Van
Posts: 9 Joined: Fri Oct 29, 2004 3:31 am
Post
by Van » Wed Nov 17, 2004 2:25 pm
Hmmm, well:
Code: Select all
scene::ITextSceneNode *MyTextNode=NULL;
MyTextNode = smgr->addTextSceneNode(font,str.c_str(),SColor(0, 255, 128, 128),0,LabelX,1);
MyTextNode->remove();
The
MyTextNode->remove(); doesn't work. Matter of fact, it won't compile. I have even tried to type cast it with ISceneNode and that doesn't work either.
The compiler (MS VS 6.0) gives the following error:
error C2227: left of '->remove' must point to class/struct/union
Any other suggestions?
bal
Posts: 829 Joined: Fri Jun 18, 2004 5:19 pm
Location: Geluwe, Belgium
Post
by bal » Wed Nov 17, 2004 4:29 pm
Make sure your node is still in scope when you call the remove() function!
Tyn
Posts: 932 Joined: Thu Nov 20, 2003 7:53 pm
Location: England
Contact:
Post
by Tyn » Wed Nov 17, 2004 5:02 pm
If you make it invisible then there is no overhead because it isn't drawn and you can reuse it.
MyTextNode->setVisible(false);
Then just put true in there if you want it to be drawn again.
jikbar
Posts: 62 Joined: Wed Aug 25, 2004 4:48 pm
Location: Canada
Contact:
Post
by jikbar » Fri Nov 19, 2004 9:27 pm
calling remove() or anything else on the node wont work because the ITextSceneNode class doesnt have an implementation outside Irrlicht.
the only declaration of the ITextSceneNode in the Irrlicht headers is
class ITextSceneNode;
dracflamloc
Posts: 142 Joined: Sat Dec 11, 2004 8:13 am
Contact:
Post
by dracflamloc » Mon Dec 13, 2004 4:47 am
Yea I need to know the answer to this as well. Have you figured it out?
dracflamloc
Posts: 142 Joined: Sat Dec 11, 2004 8:13 am
Contact:
Post
by dracflamloc » Wed Dec 15, 2004 5:54 pm
I notice in ITextSceneNode.h there is a setText command but I can not call it... it gives me a build error saying: user of undefined type 'irr:scene:ITextSceneNode'
Is the header never included anywhere? If not then where can I put it?
dracflamloc
Posts: 142 Joined: Sat Dec 11, 2004 8:13 am
Contact:
Post
by dracflamloc » Wed Dec 15, 2004 7:22 pm
Nm I'll just make my own class to encompass Font->draw()