Jump to content
  • Advertisement

Archived

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

ScrewWorkn

Text in Directx 8

This topic is 6059 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!