Hi everyone. I have a question with this function.
I have this variable: int Damage=(rand()%201 +200);
Then i want to a text on the screen representing that Damage. I try: (L"%S"+Damage); and (L"%S"+(int)Damage); too, but nothing.
I want to set the Damage value on screen. This is my current line:
font->draw(L"Damage: "+Damage,rect<s32>(enemy_damagedraw_coords.X-10,enemy_damagedraw_coords.Y-70+(DRAW_DAMAGE_AUX-255)/6,300,50),color);
enemy_damagedraw_coords, its a position2d<s32>, variable, but it doesnt matter here.
That line, the font-draw one, give me on screen letters, separated.
I only want to set the Damage value on Screen, with font->draw, but i dont know how.
Help me please, good bye!
font->draw, Question.
L"something" makes a pointer, IIRC, so you're just creating a bad pointer by doing L"something" + int. Try this:
Code: Select all
core::stringw str = L"Damage: ";
str += Damage;
font->draw(str.c_str(), ...