|
Integer blitting (text output) |
GuitarGod1134
Member #8,482
April 2007
|
im trying to output the players health and mana for my game but according to the error in deccpp |
ImLeftFooted
Member #3,935
October 2003
|
#include <sstream> using namespace std; ... stringstream ss; ss << 49; textout_ex(buffer, font, ss.str().c_str(), x, y, color, color); Or (because I know someone else is going to post this ): textprintf_ex(buffer, font, x, y, color, color, "%d", 49); On a side note: Using the same color for fg and bg is probably not what you want. I'd recommend -1 for your bg parameter. |
GuitarGod1134
Member #8,482
April 2007
|
I dont really understand the second function you did. I get the first 6 parameters but what are the last two? The int and ....? |
CGamesPlay
Member #2,559
July 2002
|
Read about the printf function: -- Ryan Patterson - <http://cgamesplay.com/> |
ImLeftFooted
Member #3,935
October 2003
|
Just stick with the first solution, its better anyway. |
LennyLen
Member #5,313
December 2004
|
You should probably read (or re-read) some tutorials on C/C++ basics as well.
|
Archon
Member #4,195
January 2004
|
Quote: Just stick with the first solution, its better anyway. I'd go with the second method for consistency. Quote: I dont really understand the second function you did. I get the first 6 parameters but what are the last two? The int and ....? text_printf is Allegro's version of the standard printf function with extra parameters (destination bitmap, colour, position). |
GuitarGod1134
Member #8,482
April 2007
|
Ok I read it. thx;D |
|