Drawing a variable

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
DanyATK
Posts: 32
Joined: Mon Mar 22, 2004 8:40 pm
Location: Italy
Contact:

Drawing a variable

Post by DanyATK »

To draw some text, I use the function:

Code: Select all

font->draw(L"Prova testo",core::rect<s32>(130,10,300,50),
                 video::SColor(255,255,255,255));
And it work perfectly... but, how I can to draw a value of variable "int a = 5;" using this function?

PS::: Excuse me if I don't speak english very well ^^
The best italian GM related site
www.gamemaker.it
warui
Posts: 232
Joined: Wed Apr 14, 2004 12:06 pm
Location: Lodz, Poland
Contact:

Post by warui »

Read about sprintf for example.
Tomasz Nowakowski
Openoko - www.openoko.pl
madinitaly
Posts: 92
Joined: Sat Nov 29, 2003 8:30 pm
Contact:

Post by madinitaly »

Code: Select all

wchar_t myString[256];
s32 myVar = 1000;

...

wsprintf (myString, L"myVar = %d", myVar);

font->draw (myString, core::rect<s32> (130, 10, 300, 50), video::SColor (0xFF, 0xFF, 0xFF, 0xFF));
And here you go :)
DanyATK
Posts: 32
Joined: Mon Mar 22, 2004 8:40 pm
Location: Italy
Contact:

Post by DanyATK »

thx :)
The best italian GM related site
www.gamemaker.it
Post Reply