Displaying text and debugging
Displaying text and debugging
Hi! I am trying to display and update some text on the screen to read out some values for control and debugging. I am currently using
virtual IGUIStaticText = gui::IGUIEnvironment->addStaticText()
to do this. The text displays as it should, but I don't know how, or if its possible to edit the text contents. Since it is a static text class, I guess this is not the favorable way to do this anyways.
So what is the best way to display text I can easily update?
*Edit. Found some sticky information about debugging software i will be looking into.
virtual IGUIStaticText = gui::IGUIEnvironment->addStaticText()
to do this. The text displays as it should, but I don't know how, or if its possible to edit the text contents. Since it is a static text class, I guess this is not the favorable way to do this anyways.
So what is the best way to display text I can easily update?
*Edit. Found some sticky information about debugging software i will be looking into.
sorry for another stupid question....B@z wrote:setText is for static text.
static text doesnt mean that it can only have one value always, but means that the user can't change it.
you can change it any time from your app.
myText->setText(L"MyText");
I have no idea about where is "myText" comes from ?
so how can I display text by using my own defined variables ?
for example, I would like to display the name of some ISceneNode object on screen.
Code: Select all
ISceneNode* cube = smgr->addCubeSceneNode(50);
cube -> setName("cube");
guienv->addStaticText( smgr->getSceneNodeFromName("cube")->getName() , rect<s32>(10,10,260,22), true,false,0,1,false);
Can anybody kindly show me how to fix this?
THX a lot
here is the error I got:hybrid wrote:big error is not what I'd call a descriptive explanation. Please make sure you understand the basic C++ things needed for this situation, and post the full compiler message if you cannot figure it out.
Code: Select all
ERROR 31 error C2664: 'irr::gui::IGUIEnvironment::addStaticText' : cannot convert parameter 1 from 'const irr::c8 *' to 'const wchar_t *' d:\_development\irrlicht\_lab\57_proto_game\src\src\main.cpp 178 57_proto_game
I realize that I need to convert c8 to wchar_t , I have already spent couple hours searching the solution, so far the results is too hard for me ... but it's ok, thanks for the remind anyway, I will keep finding it.
sorry for the "big error".