D3D11 2D Esp Box Source

Durum
Üzgünüz bu konu cevaplar için kapatılmıştır...
<Ç0rumlu>
Ultra Üye
Katılım
19 May 2016
Mesajlar
1,546
Tepki puanı
135
Ödüller
10
Yaş
29
10 HİZMET YILI
Konu Alıntıdır.
PHP:
cBoxInfo cEngine::DrawBoundingBox( Vector vHead, Vector vFoot, DWORD color, int edge, bool CalcOnly )//edge == 1 edge only, edge == 2 box + edge box[/FONT][/B][/LEFT]
[B][FONT=Arial][LEFT]{
    CVector2i iHead, iFoot;
    cBoxInfo m_Box = {0};

    //center boxes & add correction's
    vFoot.x = vHead.x;
    vFoot.z = vHead.z;

    if( WorldToScreen( vHead, iHead ) && WorldToScreen( vFoot, iFoot ) )
    {
        m_Box.iHead = iHead;
        m_Box.iFoot = iFoot;

        iFoot.y += 5;//some corrections
        iHead.y -= 7;//some corrections
        int w = ( iFoot.y - iHead.y ) / 4;

        if( CalcOnly == false )
        {
            if( edge == 1 )
            {
                DrawEdgeBoundingBox( ( iHead.x - w ), iHead.y, ( w * 2 ), ( iFoot.y - iHead.y ), color, 8 );
            } else if( edge == 2 ) {
                m_pDx11Renderer.DrawBorder( ( iHead.x - w ), iHead.y, ( w * 2 ), ( iFoot.y - iHead.y ), 1, color );
                DrawEdgeBoundingBox( ( iHead.x - w - 3 ), iHead.y - 3, ( w * 2 ) + 6, ( iFoot.y - iHead.y ) + 6, txtYellow, 6 );//draw 3 px bigger
            } else {
                m_pDx11Renderer.DrawBorder( ( iHead.x - w ), iHead.y, ( w * 2 ), ( iFoot.y - iHead.y ), 1, color );
            }

        }

        m_Box.x = ( iHead.x - w );
        m_Box.y = iHead.y;
        m_Box.w = ( w * 2 );
        m_Box.h = ( iFoot.y - iHead.y );
        m_Box.middle_x = iHead.x;
    }
    return m_Box;
}

void cEngine::DrawEdgeBoundingBox( int x, int y, int w, int h, DWORD BorderColor, int override_le, bool midpoint, bool center )
{
    //draw circle on center of box
    if( midpoint )
        m_pDx11Renderer.DrawCircle( x, y, 2, txtGreen );

    //center x y in the box
    if( center )
    {
        x -= ( w / 2 );
        y -= ( h / 2 );
    }

    int le = w / 4;

    if( le > ( h / 4 ) )
        le = ( h / 4 );

    if( override_le > 0 )
        le = override_le;

    m_pDx11Renderer.DrawLine( x, y, x + le, y, BorderColor );
    m_pDx11Renderer.DrawLine( x, y, x, y + le, BorderColor );
    m_pDx11Renderer.DrawLine( x + w, y, x + w - le, y, BorderColor );
    m_pDx11Renderer.DrawLine( x + w, y, x + w, y + le, BorderColor );
    m_pDx11Renderer.DrawLine( x, y + h, x, y + h - le, BorderColor );
    m_pDx11Renderer.DrawLine( x, y + h, x + le, y + h, BorderColor );
    m_pDx11Renderer.DrawLine( x + w, y + h, x +w - le, y + h, BorderColor );
    m_pDx11Renderer.DrawLine( x + w, y + h, x + w, y + h - le, BorderColor );
}

 
Moderatörün son düzenlenenleri:
İnsta ♥ @LazHayalet ♥
Efsane Üye
Katılım
12 May 2016
Mesajlar
5,564
Çözümler
33
Tepki puanı
4,220
Ödüller
18
Sosyal
10 HİZMET YILI
teşekkürler yararlı
 
●▬▬۩ Yozgatlı ۩▬▬●
Süper Üye
Katılım
11 Mar 2017
Mesajlar
812
Tepki puanı
146
Ödüller
8
Yaş
26
9 HİZMET YILI
Teşetkürler YARARLI KONU :S
 
Üye
Katılım
5 Ocak 2018
Mesajlar
12
Tepki puanı
2
Yaş
27
8 HİZMET YILI
saolsın ekledım hileme
 
Durum
Üzgünüz bu konu cevaplar için kapatılmıştır...