 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
dnsi0 I post too much
Reputation: 0
Joined: 04 Jan 2007 Posts: 2674
|
Posted: Sat Nov 08, 2008 12:02 pm Post subject: How do you render a directxfont...T.T |
|
|
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 |
|
 |
Dark Byte Site Admin
Reputation: 475
Joined: 09 May 2003 Posts: 25985 Location: The netherlands
|
Posted: Sat Nov 08, 2008 5:44 pm Post subject: |
|
|
| 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 |
|
 |
tombana Master Cheater
Reputation: 2
Joined: 14 Jun 2007 Posts: 456 Location: The Netherlands
|
Posted: Sun Nov 09, 2008 5:00 am Post subject: |
|
|
| 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 |
|
 |
dnsi0 I post too much
Reputation: 0
Joined: 04 Jan 2007 Posts: 2674
|
Posted: Sun Nov 09, 2008 9:07 am Post subject: |
|
|
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 |
|
 |
|
|
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
|
|