LPD3DXFONT variable output

Started by
7 comments, last by Multiverse 20 years ago
Hey there, currently starting out making a 3D game using DX9, and have implemented some LPD3DXFONT code in order to help debugging (output mesh location/orientation/speed etc) with LPD3DXFONT its relatively easy to output strings on screen, but how do i output variables in a simple and quick way? thanks for your time "what do you mean its on the wrong line? That wont work... Oh, it worked."
Advertisement
sprintf() things into a string, and output that.

I like pie.
[sub]My spoon is too big.[/sub]
Thanks for the reply RenderTarget. I''m working on it right now.
Is there a way to change the color of the text character by character rather than line by line?
"It compiles! Ship it!"
Not with that interface. Multiple draw calls, baby.

I like pie.
[sub]My spoon is too big.[/sub]
std::ostringstream ossFps;

ossFps << "FPS: " << pTimer->GetFps();

pFont->DrawText(pSprite, ossFps.str().c_str(), -1, &Rect, DT_LEFT|DT_NOCLIP, 0xffffffff);
Hi again guys. I the two suggestions sprintf() and the ostringstream method and im running into problems on both of them.

i got basic text working with both methods but not the variables i wanted to display. for example, when using the ostringstream method i get the text but my value just shows as 0 no matter what i change the variable to.

i was wondering if you could elaborate a bit on your method eFoDay like what the ''pSprite'' variable is and does. I removed the ''-1'' and replaced it with a finite number and completely removed the pSprite which is probably where im going wrong and why i want to know wot its for!

Any extra info would be greatly appreciated.
pSprite can be NULL, in which case Microsoft® Direct3D® will render the string with its own sprite object.

If Count is -1, then the pString parameter is assumed to be a pointer to a null-terminated string and ID3DXFont::DrawText computes the character count automatically.
cheers eFoDay. a really appreciate the help. i like how u put the registered trademark symbols after microsoft and Direct3D.

thanks again!

"what do you mean its on the wrong line? That wont work... Oh, it worked."

This topic is closed to new replies.

Advertisement