Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


How do you render a directxfont...T.T

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
dnsi0
I post too much
Reputation: 0

Joined: 04 Jan 2007
Posts: 2674

PostPosted: Sat Nov 08, 2008 12:02 pm    Post subject: How do you render a directxfont...T.T Reply with quote

I dont need to do all that createdevice crap cause something already does it for me.
heres the code for rendering and creating. But it doesn't work WHY?
render:
Code:
rRect.Top:=0;
  rRect.Bottom:=20;
  rRECT.Left:=0;
  RRECT.Right:=70;
  mFont.DrawTextA('HIAGDSasfdlsagfdas',0,rRect,0,D3DCOLOR_XRGB(255,255,255));


create:
Code:
  mh := CreateFont(25, 70, 0, 0, 0, 0, 0, 0, ANSI_CHARSET, 0, 0, 0, 0, 'verdana');
  D3DXCreateFont(dxDevice,mh,mFont);
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 475

Joined: 09 May 2003
Posts: 25985
Location: The netherlands

PostPosted: Sat Nov 08, 2008 5:44 pm    Post subject: Reply with quote

Quote:

mFont.DrawTextA('HIAGDSasfdlsagfdas',0,rRect,0,D3DCOLOR_XRGB(255,255,255));


according to the docs I use:
Code:

INT DrawText(
  LPD3DXSPRITE pSprite,
  LPCTSTR pString,
  INT Count,
  LPRECT pRect,
  DWORD Format,
  D3DCOLOR Color
);

let's check the parameters:
1: you're missing the pSprite parameter (can be NULL/nil if you like)
2: string, HIAGDSasfdlsagfdas, looks ok, although i'd usually force it to a pchar just to make sure. (pchar('HIAGDSasfdlsagfdas') )
3: you're providing as length 0, but for this function to let it find the end of the string itself, you must give it -1 (now it's writing 0 characters of that string instead of the full string)
4: I take that the function declaration is declared as a var xxx: trect else that's a problem...
5: format is 0, default, nothing wrong with that
6: color, I guess that's ok. I myself always mess transparency up, which is why I usually use D3DCOLOR_ARGB(127,255,255,255) just to be sure at least something is outputed. (not sure if 0 if full trransparent or 255, so 127 sites nicely inbetween)


also, you didn't specify what isn't working. Are you getting access violation errors or doesn't it just show anything on the screen ?

_________________
Tools give you results. Knowledge gives you control.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
tombana
Master Cheater
Reputation: 2

Joined: 14 Jun 2007
Posts: 456
Location: The Netherlands

PostPosted: Sun Nov 09, 2008 5:00 am    Post subject: Reply with quote

What version of directx is it for? If it's for directx9, then do what Dark Byte said. However I don't know if those parameters also apply for previous versions of directx.
Back to top
View user's profile Send private message
dnsi0
I post too much
Reputation: 0

Joined: 04 Jan 2007
Posts: 2674

PostPosted: Sun Nov 09, 2008 9:07 am    Post subject: Reply with quote

All hooks work but text wont show. No Errors, And I am using directx 8.

I would be happier if maplestory didn't use directx8... cause most tutorials I found were on directx9... T.T
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites