LPD3DXFONT variable output
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."
Is there a way to change the color of the text character by character rather than line by line?
std::ostringstream ossFps;
ossFps << "FPS: " << pTimer->GetFps();
pFont->DrawText(pSprite, ossFps.str().c_str(), -1, &Rect, DT_LEFT|DT_NOCLIP, 0xffffffff);
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.
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.
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement