Results 1 to 5 of 5
  1. #1
    TheMaTriX's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Posts
    37
    Reputation
    10
    Thanks
    0

    crosshair and text

    hello i am very new in c++ and d3d
    how can i make a crosshair?
    and how can i print "hello" in d3d
    and how can i make my dll to bypass the hackshield and make it work in ca

    thx : )

  2. #2
    -Dimensions-'s Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    243
    Reputation
    2
    Thanks
    161
    My Mood
    Aggressive
    I'm pretty sure someone has posted their crosshair / text D3D functions before.

    Here are my old ones:

    Code:
    void DrawPrint( int x, int y, D3DCOLOR Color, const char *fmt, ... )
    {
    	RECT FontPos = { x, y, x + 120, y + 16 };
    	char buf[1024] = {'\0'};
    	va_list va_alist;
    
    	va_start(va_alist, fmt);
    	vsprintf_s(buf, fmt, va_alist);
    	va_end(va_alist);
    
    	pFont->DrawText(NULL, buf, -1, &FontPos, DT_NOCLIP, Color);
    }
    
    void DrawCrosshair( LPDIRECT3DDEVICE9 pDevice, int size, int strong,  D3DCOLOR Color )
    {
    	if ( !pDevice )
    		return;
    
    	int iCenterX = 512; //GetSystemMetrics( 0 ) / 2;
    	int iCenterY = 384; //GetSystemMetrics( 1 ) / 2;
    	if ( iCenterX < 20 && iCenterY < 20 )
    	{
    		iCenterX = ( GetSystemMetrics( 0 ) / 2 );
    		iCenterY = ( GetSystemMetrics( 1 ) / 2 );
    	}
    	D3DRECT pRectX1 = { iCenterX - size, iCenterY, iCenterX + size, iCenterY + strong};
    	D3DRECT pRectX2 = { iCenterX, iCenterY - size, iCenterX + strong, iCenterY + size};
    	pDevice->Clear( 0, &pRectX1, 0, Color, 0, 0);
    	pDevice->Clear( 0, &pRectX2, 0, Color, 0, 0);
    }

  3. #3
    TheMaTriX's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Posts
    37
    Reputation
    10
    Thanks
    0
    pfont is undefined

  4. #4
    -Dimensions-'s Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    243
    Reputation
    2
    Thanks
    161
    My Mood
    Aggressive
    Define it then. Come on, don't be lazy.
    Create a class, and add
    Code:
    LPD3DXFONT pFont;
    and then call it in the function.
    Example:
    Code:
    class cDirectX{
    public:
    	LPD3DXFONT pFont;
    };
    extern class cDirectX directx;
    Then in the function make sure the pFont is defined from the directx class:
    Code:
    directx.pFont->DrawText(NULL, buf, -1, &FontPos, DT_NOCLIP, Color);
    Please Thank people when they helped you.
    Don't forget to create and reset the font properly. That I will not help you with.
    Last edited by -Dimensions-; 02-11-2012 at 08:15 AM.

  5. #5
    TheMaTriX's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Posts
    37
    Reputation
    10
    Thanks
    0
    thx man: )
    and i am not lazy i just dont know how
    and thx again: ) .....

Similar Threads

  1. Replies: 11
    Last Post: 08-14-2009, 02:17 PM
  2. How to change crosshair and color in Crossfire
    By LuckiiEmoo in forum CrossFire Hacks & Cheats
    Replies: 3
    Last Post: 08-03-2009, 03:42 PM
  3. CrossHair and Textured
    By 3dimage in forum Combat Arms Hacks & Cheats
    Replies: 9
    Last Post: 04-16-2009, 08:34 PM
  4. hack crosshair and actual crosshair not alined
    By webhead24 in forum Combat Arms Hacks & Cheats
    Replies: 8
    Last Post: 01-11-2009, 01:44 AM
  5. Help with Crosshairs and VB6!
    By condor01 in forum WarRock - International Hacks
    Replies: 4
    Last Post: 07-03-2007, 09:39 PM