I am trying to print the mouses coordinates on the gamescreen with the help of dbMouseX(), dbMouseY() and dbText(x,y,char*).
This sounds like it should be a simple task, but as I have been away from C++ for quite some time messing about with VB instead and now thanks to Dark GDK found a reason to go back to C++. In short, I am a bit confused.
As you already have figured out the problem is that I want to print an integer where a char* is required (I want to print x and y on seperate lines).
This is what I have done so far:
void DarkGDK ( void )
{
dbSyncOn ( );
dbSyncRate ( 60 );
int iMX = 0; // Prepare an integer for mouseX coords
char* sString = ""; // prepare a printable string
// our main loop
while ( LoopGDK ( ) )
{
dbText(10,10,"Test 1");
iMX = dbMouseX(); // Place the mouse current coord in iMX
dbStr$ ( sString, iMX ); // Convert int to the string sString
dbText( 10, 30, sString); // Print the converted value
dbSync ( );
}
return;
}
And hey! Stop laughing, :p I know this is a rookie thing but some ppl actually need to ride a bike again sometimes.
Any tips on how to make this happen is highly appreciated.
Thanks
-Patrik