Quote:
Originally Posted by I2espect
create a font and use it to write text on screen fail with my Endscene hook !!!
and if i tried to draw anything on the screen it works ! but text = fail !!?
any suggestion ?!
|
Try this:
Code:
void PrintText(char pString[], int x, int y, D3DCOLOR col, ID3DXFont *font)
{
RECT FontRect = { x, y, x+500, y+30 }; //You can change this size if you want to make a small text
font->DrawText( NULL, pString, -1, &FontRect, DT_LEFT | DT_WORDBREAK, col);
}
LPD3DXFONT pFont;
D3DXCreateFontA(pDevice,10, 0, FW_BOLD, 1, FALSE, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, "Lucida Console", &pFont); //Create the font and put it in pFont
PrintText("My D3D Text", 0, 0, D3DCOLOR_ARGB(255,0,255,0), pFont); //Create a green text at location x = 0 and y = 0