Hey guys, I'm quite a beginner so go easy on me if this information is easily obtained through some guide here or something.
I'm having a hard time understanding how the GUI works in Irrlicht. So far I've learned how to add an Image and how to write a static text. Problem is I don't know how to remove/edit the image/text and I dont know how to write out variable values in text.
As you can see in the screenshot below, the top-left image should be there at all times. But the one below it should dissappear when you press 1-4 and the tower get built (I've allready managed to make it appear only after pressing B). I also want to be able to write out all the data you can see at the very top in the windows-frame in the black boxes of the GUI.
Which would be the easiest/best way to do this? I would like to be able to change the size of the text and maybe even the font of it, but that's not a requirement
Last edited by MaloW on Sat Feb 13, 2010 2:40 pm, edited 1 time in total.
You can do the same thing with the static text.
If I where you I would first create a "createTowerGUI-method" that draws your tower building menu and then create a "rmoveTowerGUI-metod" that would remove all components associated with the that gui.
To write out variable values you have to do something like this:
This is from one of my projects and handels the score display; I create an empty temp sting add my current score to it (an int), convert it to const wchar_t and then I set the static text score_text to display my ScorePointer.
It'll only take a minute or two to debug this code...
The img->remove(); part doesnt really seem to work for me though. Nothing happends, the .jpg image stays visable.
The text part worked excellent, now I don't get converting errors from int to wchar anymore. Allthough I'm having the same problem here now aswell, text->remove(); doesnt seem to work for text either. So my values of the varibles just keep writing on top of the old ones, which ends in a very cluttered area with alot of numbers written on top of each other.
Did I do anything wrong setting it up or is it because of the new Irrlicht version that I'm getting these errors? Since I don't really understand them help would be appreciated
Judging from the error messages it's because of the new Irrlicht version. You have to take a look in the API to see how you should call the newer version of the getCollisionpoint-method.
It'll only take a minute or two to debug this code...