Skip to main content
GameDev.net gamedev.net
🔒 Locked

Write numbers to surface ? (Corrected)

Started by Urax Nov 10, 2000 at 6:38 AM 0 replies 200+ views
Original Post
Urax
Urax
Hi I´m a beginner at this so this might sound easy, but I can´t figure it out. I would like to write the score in a game with two players. The player info together with the score is stored in a class. To write the score to the surface I need to convert the int to a char* (I think). It works when I DON`T use the class. --- score=10; sprintf(buffer," %d",score); Draw_Text(buffer,120,580,Player1._color,lpDDSPrimary,font); --- How do I make it work using a class ?
IronBrain
IronBrain
It is the same way !
Be sure that your class is global and score is public !!


GameMain()
{
char x[32];
wsprintf(x,"%i",Yourclass.score);
Draw_Text(....);
}

Edited by - IronBrain on November 10, 2000 8:05:03 AM

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.