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

D3DFont

Started by rkennedy9064 Jun 20, 2010 at 2:57 PM 1 replies 1.4k views
Original Post
rkennedy9064
rkennedy9064
I've been working on a simple pong game for a while now and have pretty much everything down, the AI paddle follows the ball, the ball and paddle speeds change, and there are a few differents start screens. The last thing I'm trying to do is keep score. I was just wondering, since d3dfont->DrawText() takes an LPCWSTR as its text parameter, is there a simple way to append an int i use to keep track of the score on the back in order to display the scores on the screen? I havn't found much information regarding manipulating LPCWSTR's.
Burnhard
Burnhard
The best way I know of is this:

int score = 1234;

std::wostringstream o;

o << L"The score is " << score;

DrawText(.... o.str().c_str() .... );
rkennedy9064
rkennedy9064
That worked perfectly, thanks for the help.

Topic Locked

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

Sign in to reply to this topic.