AddTextSceneNode (try to change text )
AddTextSceneNode (try to change text )
Hi
How do i change the text in AddTextSceneNode that as already been created??
Or how do i eliminate an AddTextSceneNode so i can creat a new one in the same place?
Here is the code i use to create the text:
device_.SceneManager.AddTextSceneNode(device_.GUIEnvironment.BuiltInFont,
caption, new Irrlicht.Video.Color(255, 255, 255, 255), sceneNode,new Vector3D(0, sceneNode.TransformedBoundingBox.MaxEdge.Y + 4, 0), 0);
thanks!
How do i change the text in AddTextSceneNode that as already been created??
Or how do i eliminate an AddTextSceneNode so i can creat a new one in the same place?
Here is the code i use to create the text:
device_.SceneManager.AddTextSceneNode(device_.GUIEnvironment.BuiltInFont,
caption, new Irrlicht.Video.Color(255, 255, 255, 255), sceneNode,new Vector3D(0, sceneNode.TransformedBoundingBox.MaxEdge.Y + 4, 0), 0);
thanks!
i don't know if the text scene node provides a setText function but checking the API for this would be a sensible thing to do. Obviously you'd store the pointer returned by addTextSceneNode so that you could later change it.
If there is no such function provided then you can remove the text scene node in the usual way you would remove a node, again requiring the pointer to have been stored, then you call remove() on that pointer (though it seems you're not using C++ so it wouldn't be a pointer i guess).
If there is no such function provided then you can remove the text scene node in the usual way you would remove a node, again requiring the pointer to have been stored, then you call remove() on that pointer (though it seems you're not using C++ so it wouldn't be a pointer i guess).
-
- Posts: 49
- Joined: Tue Jan 23, 2007 12:36 pm
- Location: Bedford, UK
Can you not do this:
or the c# equivalent which would be:
Code: Select all
// create the text scene node
ITextSceneNode *txt = Device->getSceneManager()->addTextSceneNode (...);
....
// change the text
txt->setText(L"New Text");
Code: Select all
txt.setText(L"New Text");
Nop...Can you not do this:
Code:
// create the text scene node
ITextSceneNode *txt = Device->getSceneManager()->addTextSceneNode (...);
....
// change the text
txt->setText(L"New Text");
or the c# equivalent which would be:
Code:
txt.setText(L"New Text");
Strangely addTextSceneNode doesn't have that function.
Found in 2.9 seconds:
The best thing you can do when you know the class is open Irrlicht Class List Documentation then push Ctrl + F and type in the class name you want to find: ITextSceneNode. Finally, you push Ctrl + F again and search for a keyword in the function, or just browse the function list.Irrlicht Documentation wrote: virtual void setText (const wchar_t *text)=0
sets the text string
TheQuestion = 2B || !2B
-
- Posts: 4
- Joined: Sun Jan 20, 2008 7:37 am
just another problem also related with AddTextSceneNode
I am now working on my project in which I will have a number be displayed above some nodes at certain instant. I have just tried this function and wanted to ask some further questions.
1. How can the font size be set larger ? It seems that setScale doesn't work for me.
2. Is the position fixed ? It seems that when i rotate the camera, the text started to displace to other positions ?
Thanks
I am now working on my project in which I will have a number be displayed above some nodes at certain instant. I have just tried this function and wanted to ask some further questions.
1. How can the font size be set larger ? It seems that setScale doesn't work for me.
2. Is the position fixed ? It seems that when i rotate the camera, the text started to displace to other positions ?
Thanks
Got the same problem, trying to change text of an already created scenenode. I`m also using the .net api and found no iSceneTextNode in it.
Any solutions so far ?
---edit---
I tried to remove the nodes and recreate them but that sometimes causes an accessviolationexception trying to access secured memory in the drawall() method of the scenemanger after several seconds.
Any solutions so far ?
---edit---
I tried to remove the nodes and recreate them but that sometimes causes an accessviolationexception trying to access secured memory in the drawall() method of the scenemanger after several seconds.