Help me with D3DX Font interface!!!!
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!!!!
Here is an example of the use of LPD3DXFONT.
Edited by - errand on January 11, 2001 2:10:18 AM
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
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
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
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?"
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?"
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.
quote:
Use the CD3DFont class that comes with the samples instead.
Oh, OF COURSE!
Uhm, how?
-----------------
The Goblin
-----------------
"Oh, God..."
"Yes?" <- My Response
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement