Author Topic: dx8 overlay text  (Read 1509 times)

0 Members and 1 Guest are viewing this topic.

Behemoth

  • Intentional Cheater
  • **
  • Posts: 45
    • View Profile
dx8 overlay text
« on: June 10, 2009, 01:55:17 am »
hey,

need help (example would be lecherous) for overlay a text in a dx8 game...


thanx  :icon_o_o
Don't follow me - I walk into walls.

Jurugi

  • Online Villain
  • ***
  • Posts: 190
    • View Profile
Re: dx8 overlay text
« Reply #1 on: June 10, 2009, 02:23:18 am »
Ok I'll help youu OK? ok  :icon_teehee


 :icon_magician


Ok in D3D8 there's no built in easy text class like D3D9 has, as you probably know.

So you need to make a font class and then render it to screen. Now referring to my OFP hook..
First make a declaration for your font as well as an HFONT
ID3DXFont *MaiFont;
HFONT fnt;

Here's my draw text:

void _DrawText( char pString[], int x, int y, D3DCOLOR col)
{
   RECT FontRect = { x, y, x+120, y+50 };
   MyFont->DrawTextA(pString, -1, &FontRect, DT_LEFT, col);
}


Then, initialize your font:

fnt = CreateFont(15, 8, 2, 0, 500, 0, 0, 0, ANSI_CHARSET, OUT_DEFAULT_PRECIS,
CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, FF_YOURFONT, 0);

And.. I'll leave the rest up to you..
Hint: draw the text where it renders on only 1 frame (or it'll end up fps lagging quite a bit). I've changed some small things so that its not c+p.

Tell me if you need more help, but this should be enough.
« Last Edit: June 10, 2009, 03:40:55 am by Jurugi »

Behemoth

  • Intentional Cheater
  • **
  • Posts: 45
    • View Profile
Re: dx8 overlay text
« Reply #2 on: June 11, 2009, 06:40:54 pm »
hehe... got it ^^

thanx  :icon_rolleyes2
Don't follow me - I walk into walls.