Another question how to write something :)
extern void printTextScreen(int x, int y, const char* text, u32 color);
How do I write the text?
I want it to show the value of this variable:
double dist;
But this doesn't work:
printTextScreen(32, 32, dist, 0xFFFFFFFF);
How do I write the text in printTextScreen(); ?
your printTextScreen needs a char * .
you want to print a double (dist, so you have to translate the double into a string. sprintf does the job.
sprintf needs a string ( buffer) that will contain the string, the variable you want to translate (dist) and the format => "%lf"
lt means the variable (dist) is a double.
If you wanted to transform an integer you would have set "%d".
you want to print a double (dist, so you have to translate the double into a string. sprintf does the job.
sprintf needs a string ( buffer) that will contain the string, the variable you want to translate (dist) and the format => "%lf"
lt means the variable (dist) is a double.
If you wanted to transform an integer you would have set "%d".
--pspZorba--
NO to K1.5 !
NO to K1.5 !
Have a read of this http://www.cplusplus.com/reference/clib ... rintf.html
for float use: "%f".
see this http://www.opengroup.org/onlinepubs/007 ... rintf.html page for more information about using conversion specification
see this http://www.opengroup.org/onlinepubs/007 ... rintf.html page for more information about using conversion specification