Glad to help.
You can create your own set of functions to format strings the way you want. This is an example of a how do your own formatted strings:
// in the .h file
// include files that are needed
#include <string.h>
#include <stdarg.h>
// prototype for the function (the '...' is meant to be exactly that)
const char* format_my_way(const char* fmt, ...);
// in the .cpp file
char big_string[1024];
const char* format_my_way(const char* fmt, ...)
{
// handle the input
va_list args;
// create our own string
va_start(args,fmt);
vsnprintf(big_string, 1024, fmt, args);
va_end(args);
// return constant
return (const char*)big_string;
}
The 'vsnprintf' version makes sure that the formatting doesn't overflow the buffer.
In your code, you would then do:
agk::SetTextString(scoreDisplayText,format_my_way("%d",score));
Cheers,
Ancient Lady
AGK Community Tester