addTextSceneNode - great feature, how do you delete it?

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
Van
Posts: 9
Joined: Fri Oct 29, 2004 3:31 am

addTextSceneNode - great feature, how do you delete it?

Post by Van »

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 »

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 »

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 »

Make sure your node is still in scope when you call the remove() function!
General Tools List
General FAQ
System: AMD Barton 2600+, 512MB, 9600XT 256MB, WinXP + FC3
Tyn
Posts: 932
Joined: Thu Nov 20, 2003 7:53 pm
Location: England
Contact:

Post by Tyn »

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 »

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 »

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 »

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 »

Nm I'll just make my own class to encompass Font->draw()

:D
Post Reply