Solved D3D9 Draw Text

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat
Status
Not open for further replies.

Clarityworld

Jr.Coder
Full Member
Nobleman
Feb 20, 2015
71
523
2
Hey guys.


I would like to start by drawing text over a game. like "Hello world!"in the top left of the screen. Also would like to use it in my current project which is external.

Can anyone recommend some good and thorough tutorials on programming some Direct X 9 stuff (in c++) ?

Thanks guys!
 

Clarityworld

Jr.Coder
Full Member
Nobleman
Feb 20, 2015
71
523
2
I actually found this series. Sadly the guy who made it seems to be a bit slow while talking, but it should be okay to get the hang of it. If somebody can find something better, please let us know! :)
Well thanks for the hint but it's not really the thing what i'm looking for.
Ty anyway
 

till0sch

Respected Hacker
Dank Tier VIP
Dank Tier Donator
Oct 14, 2012
1,104
12,593
51
C++:
void Draw_Text(LPCSTR TextToDraw, D3DCOLOR color)
{
	dx_Font->DrawTextA(NULL, TextToDraw, strlen(TextToDraw), &pos, DT_NOCLIP, color);
}
dx_Font is of type ID3DXFont*

and you need to call

C++:
void ReFont(LPDIRECT3DDEVICE9 pDevice)
{
    if (dx_Font != 0)
	{
		dx_Font->Release();
	}
    
	dx_Font = 0;
    D3DXCreateFontA(pDevice, 16, 6, FW_BOLD, 0, 0, DEFAULT_CHARSET, OUT_TT_ONLY_PRECIS, PROOF_QUALITY, DEFAULT_PITCH | FF_DONTCARE, "Arial", &dx_Font );
}
from your endscene for it to be created new all the time. Hope this helps.. Obviously requires endscene hook.
 

c5

Kim Kong Trasher
Dank Tier VIP
Dank Tier Donator
Jul 19, 2012
1,187
12,638
76
and you need to call

C++:
void ReFont(LPDIRECT3DDEVICE9 pDevice)
{
    if (dx_Font != 0)
	{
		dx_Font->Release();
	}
    
	dx_Font = 0;
    D3DXCreateFontA(pDevice, 16, 6, FW_BOLD, 0, 0, DEFAULT_CHARSET, OUT_TT_ONLY_PRECIS, PROOF_QUALITY, DEFAULT_PITCH | FF_DONTCARE, "Arial", &dx_Font );
}
from your endscene for it to be created new all the time. Hope this helps.. Obviously requires endscene hook.
Why would you recreate font all the time? Just handle device loss in Reset hook accordingly.
 
Status
Not open for further replies.
Attention! Before you post:

Read the How to Ask Questions Guide
99% of questions are answered in the Beginner's Guide, do it before asking a question.

No Hack Requests. Post in the correct section.  Search the forum first. Read the rules.

How to make a good post:

  • Fill out the form correctly
  • Tell us the game name & coding language
  • Post everything we need to know to help you
  • Ask specific questions, be descriptive
  • Post errors, line numbers & screenshots
  • Post code snippets using code tags
  • If it's a large project, zip it up and attach it

If you do not comply, your post may be deleted.  We want to help, please make a good post and we will do our best to help you.

Community Mods