Variables

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
RoboWarrior
Posts: 4
Joined: Fri Sep 03, 2010 8:31 am

Variables

Post by RoboWarrior »

How to print a variable in the screen, in the graphic engine not in the console? thank you!
Murloc992
Posts: 272
Joined: Mon Apr 13, 2009 2:45 pm
Location: Utena,Lithuania

Re: Variables

Post by Murloc992 »

RoboWarrior wrote:How to print a variable in the screen, in the graphic engine not in the console? thank you!
I strongly recommend reading all the tutorials, it shows how to do all that stuff. :)
rtr_18
Posts: 60
Joined: Thu Jun 10, 2010 8:35 am
Location: Programmer

Post by rtr_18 »

RoboWarrior wrote:
How to print a variable in the screen
Hi!
By this time, you might have found how to do this. If not, here is how to do this:

Add a static Text to the screen and set your variable as first parameter to the

Code: Select all

addStaticText()
function.

Code: Select all

    int i = 20;
	stringw text = "This is i:";
	text += i;
	device->getGUIEnvironment()->addStaticText(text.c_str(),recti(100,50,300,100));
slavik262
Posts: 753
Joined: Sun Nov 22, 2009 9:25 pm
Location: Wisconsin, USA

Post by slavik262 »

You're going to want to hang on to the pointer to the IGUIStaticText object if you want to update it as time goes on.
Post Reply