Archived

This topic is now archived and is closed to further replies.

ScrewWorkn

Text in Directx 8

Recommended Posts

Wondered if anyone had a good tutorial on doing Text in Directx8. This is what I''m doing now, but I feel like it''s not the fastest way to be doing it. It works, just wondered if you guru''s had any thoughts.
  
void clsDx::InitFont()
{

	c_hFont = CreateFont(48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, PROOF_QUALITY, 0, "Comic Sans MS");
	D3DXCreateFont(c_d3dDevice, c_hFont,&c_Font);
}

void clsDx::DrawText(char * Text)
{
	RECT	Rect;

	Rect.top =0;
	Rect.bottom = HEADERSPACE;
	Rect.left = 100;
	Rect.right = 200;

	c_Font->DrawText(Text, -1, &Rect, DT_CENTER, D3DCOLOR_RGBA(0, 0, 0, 255)); 
}
  

Share this post


Link to post
Share on other sites
D3DFont has everything you need, including a few bugs...

I will post the fixes and a sample project very soon on my website.

Monkey: This is exactly what D3DFont or D3DXCreateFont are doing with having to bother with any external tool.



Laurent - http://www.lafaqmfc.com/
My little game: http://www.lafaqmfc.com/starshooter.htm

Share this post


Link to post
Share on other sites