Jump to content
  • Advertisement

Archived

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

BenjaPrieto

Help me with D3DX Font interface!!!!

This topic is 6493 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

How do you exactly use it? Where is some example that uses D3DX font interface (not the CFont class)?? Plaese I need really badly some help!!!!

Share this post


Link to post
Share on other sites
Advertisement
Here is an example of the use of LPD3DXFONT.
    
LPD3DXFONT g_pD3DXFont;

HFONT hFont = CreateFont(28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, PROOF_QUALITY, 0, "Arial");

D3DXCreateFont(d3dDevice, hFont, &g_pD3DXFont);
// d3dDevice is a valif D3D Device


RECT rTemp = {0, 0, 800, 200};

g_pD3DXFont->DrawText("D3DXCreateFont example", -1, &rTemp, DT_LEFT, D3DCOLOR_RGBA(255, 120, 120, 255));



Edited by - errand on January 11, 2001 2:10:18 AM

Share this post


Link to post
Share on other sites
Wow, is it really that easy?

I never knew... coooooool...

So, uhm, Mr. Errand, I don''t suppose you could show a little explanation of what ALL those arguments are? Just a bit confused...

-----------------
The Goblin
-----------------
"Oh, God..."
"Yes?" <- My Response

Share this post


Link to post
Share on other sites
The information on the WinAPI command ''CreateFont'' can be found in the WinAPI help file, or online here.

For the D3D DrawText:

INT DrawTextA(
LPCSTR pString,
INT Count,
LPRECT pRect,
DWORD Format,
D3DCOLOR Color
);

Where pString is the string to print, Count is how many characters to print(-1 means all chars, but only used if null terminated string), pRect is the rectangle to print the text in, Format is ''Centered, left, right'' ect. and color should be self explanitory. It is all documented in the DX help file and goes into a bit more detail.

"I kinda think, therefore, I kinda... am?"

Share this post


Link to post
Share on other sites
Don''t use this object. It is VERY slow. It basically uses GDI to draw the text to a texture, then draw the texture to the backbuffer. Use the CD3DFont class that comes with the samples instead.

Share this post


Link to post
Share on other sites
quote:

Use the CD3DFont class that comes with the samples instead.



Oh, OF COURSE!

Uhm, how?

-----------------
The Goblin
-----------------
"Oh, God..."
"Yes?" <- My Response

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!