Results 1 to 8 of 8
  1. #1
    sam22's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Location
    Behind u
    Posts
    773
    Reputation
    33
    Thanks
    880
    My Mood
    Amazed

    Arrow How to Make a D3D Crosshair

    Hello guys here is how to make a d3d crosshair enjoy.

    this how you make a d3d crosshair you use the Starter kit or make your own one i suggest if your good at coding to make your own because the starter kit is well detected . here is the code
    in Globals put this (Hint. in the top of your source code)

    Code:
    float ScreenCenterX = 0.0f;//Horizontal Position 
      float ScreenCenterY = 0.0f;//Vertical Position  
      bool crosshair = false; 
      D3DCOLOR redt = D3DCOLOR_XRGB( 255, 0, 0 );
    next
    in setviewport add this ( Hint: to find the set View port in starter kit press ctrl and f and serch setview port)

    Code:
    ScreenCenterX = ( float )pViewport->Width / 2; 
              ScreenCenterY = ( float )pViewport->Height / 2;
    and add this in endsance( hint; you find this as well by pressing ctrl and f and typing the name )

    Code:
      if(crosshair) 
         {  
           D3DRECT rec2 = {ScreenCenterX-20, ScreenCenterY, ScreenCenterX+ 20, ScreenCenterY+2}; 
        D3DRECT rec3 = {ScreenCenterX, ScreenCenterY-20, ScreenCenterX+ 2,ScreenCenterY+20}; 
                                      
        m_pD3Ddev->Clear(1, &rec2, D3DCLEAR_TARGET,redt, 0,  0); 
        m_pD3Ddev->Clear(1, &rec3, D3DCLEAR_TARGET,redt, 0,  0); 
    //Add hotkey
    and this how you would add hotkeys
    Code:
    if (GetKeyState(VK_F4) &1)
    {
    //Code here
    }
    so it would be like
    this
    Code:
    if (GetKeyState(VK_F4) &1)          //<----- this don't need to be f4 it can be any button but rember  Big later 
    {
       Crosshair = ! crosshair 
    }
    and rember to add this in the top as well
    Code:
    bool crosshair = false;
    credits to me ( Ao Team) and I will show you how to make glass walls and more see you guys than
    AND if you need any help write here
    press thank!!!!
    /
    Last edited by sam22; 11-28-2010 at 10:07 AM.

  2. #2
    whit's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Posts
    7,159
    Reputation
    490
    Thanks
    2,253
    Nice Tut i guess..
    But im Pretty sure everyone can make a crosshair ..

  3. #3
    sam22's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Location
    Behind u
    Posts
    773
    Reputation
    33
    Thanks
    880
    My Mood
    Amazed
    Quote Originally Posted by whit View Post
    Nice Tut i guess..
    But im Pretty sure everyone can make a crosshair ..
    Thanks but no everyone can make a crosshair

  4. #4
    whit's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Posts
    7,159
    Reputation
    490
    Thanks
    2,253
    Really..
    That the simplest thing to do with the Directx sdk

  5. #5
    sam22's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Location
    Behind u
    Posts
    773
    Reputation
    33
    Thanks
    880
    My Mood
    Amazed
    Quote Originally Posted by whit View Post
    Really..
    That the simplest thing to do with the Directx sdk
    sure it is but can u make it undetected lol

  6. #6
    /b/oss's Avatar
    Join Date
    Feb 2010
    Gender
    male
    Posts
    13,651
    Reputation
    795
    Thanks
    3,547
    /moved to tut!

    thanks!

  7. #7
    Julma Henri's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Posts
    3,528
    Reputation
    205
    Thanks
    775
    My Mood
    In Love
    What program u use to make ?
    Help me get donator.



    Want to become part of Editor Force? Click the tag below and apply now !

  8. #8
    sam22's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Location
    Behind u
    Posts
    773
    Reputation
    33
    Thanks
    880
    My Mood
    Amazed
    Quote Originally Posted by iSuckX View Post
    What program u use to make ?
    C++ expres is free for micorsoft