How would I convert a float to a string so that it may be displayed as text for example:
#include "DarkGDK.h"
void DarkGDK( void )
{
dbSyncOn();
//dbSetDisplayMode (800, 600, 16);
dbMakeObjectCube(1, 10.0);
dbMoveCamera(-50);
float x = dbObjectPositionX(1);
float y = dbObjectPositionY(1);
float z = dbObjectPositionZ(1);
dbText(x, y - 50.0, "xPos = " /* How do I convert a float to string?!? */ );
dbPositionObject(1, x, y, z);
while (!dbSpaceKey()) {
dbSync();
}
}
In another C based language I use we would do it like this:
float x = 5.0;
Print("x = " + FloatToString(x));
I tried a few variations but I can't figure it out, help please
[Edit]
Ok I found the function I need, dbStr(x) however I have no idea how to link it to text, for example "x = " + dbStr(x) does not work :/
- Scarface